mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-19 15:01:57 +02:00
localization based on markdown
This commit is contained in:
@@ -2,9 +2,6 @@ var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
// see http://jlongster.com/Backend-Apps-with-Webpack--Part-I
|
||||
var externals = false;
|
||||
|
||||
// Bundle entry point
|
||||
var entry = ['./components/App.jsx'];
|
||||
|
||||
@@ -20,7 +17,7 @@ var output = {
|
||||
// Necessary webpack loaders for converting our content:
|
||||
var webpackLoaders = [
|
||||
'babel-loader',
|
||||
'eslint',
|
||||
'eslint-loader',
|
||||
__dirname + '/lib/latex-loader',
|
||||
__dirname + '/lib/pre-loader',
|
||||
__dirname + '/lib/p-loader'
|
||||
@@ -30,8 +27,6 @@ var plugins = [];
|
||||
|
||||
// Dev mode: make certain concessions to speed up dev work.
|
||||
if(process.argv.indexOf("--prod") === -1 && process.argv.indexOf("--lint")) {
|
||||
// use the webpack hot Reload server:
|
||||
entry.push('webpack/hot/dev-server');
|
||||
// allow code in textareas when in dev mode:
|
||||
webpackLoaders.push(__dirname + '/lib/textarea-loader');
|
||||
}
|
||||
@@ -41,26 +36,7 @@ else if(process.argv.indexOf("--prod") > -1) {
|
||||
plugins.push(new webpack.optimize.UglifyJsPlugin());
|
||||
}
|
||||
|
||||
// However, do we want one full page, or single pages with react-router?
|
||||
if(process.argv.indexOf("--singles") !== -1 ) {
|
||||
entry = ['./lib/site/routemap.js'];
|
||||
|
||||
target = "node";
|
||||
|
||||
output = {
|
||||
path: output.path + '/pages',
|
||||
filename: "routemap.js",
|
||||
library: "routemap",
|
||||
libraryTarget: "commonjs2"
|
||||
};
|
||||
|
||||
console.log("\n","marking node_modules as external","\n");
|
||||
externals = {};
|
||||
fs.readdirSync('node_modules')
|
||||
.filter(function(x) { return ['.bin'].indexOf(x) === -1; })
|
||||
.forEach(function(mod) { externals[mod] = 'commonjs ' + mod; });
|
||||
plugins.pop();
|
||||
}
|
||||
console.log("content for entry:", entry);
|
||||
|
||||
// And the final config that webpack will read in.
|
||||
module.exports = {
|
||||
@@ -85,15 +61,12 @@ module.exports = {
|
||||
test: /.jsx?$/,
|
||||
include: [
|
||||
/components/,
|
||||
/lib.site/
|
||||
/lib.site/,
|
||||
/locales/
|
||||
],
|
||||
loaders: webpackLoaders
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: plugins,
|
||||
eslint: {
|
||||
configFile: __dirname + '/.eslintrc'
|
||||
},
|
||||
externals: externals
|
||||
plugins: plugins
|
||||
};
|
||||
|
Reference in New Issue
Block a user