1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 02:12:53 +00:00

fixing bundling - it's too big

This commit is contained in:
2016-10-17 20:42:32 +00:00
parent 090f580d23
commit 29778cadc1
4 changed files with 27 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ var autoprefixer = require('autoprefixer');
module.exports = {
devtool: debug ? "inline-sourcemap" : null,
entry: ["babel-polyfill", , "whatwg-fetch", "./client/js/app.js"],
entry: ["babel-polyfill", "./client/js/app.js"],
module: {
loaders: [
{
@@ -35,17 +35,27 @@ module.exports = {
publicPath: "/public/",
filename: "client.min.js"
},
plugins: debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
plugins: [
new HtmlWebpackPlugin({
plugins: getPlugins(),
externals:{hljs: "hljs"}
};
function getPlugins(){
var plugins = [
new HtmlWebpackPlugin({
fileName: 'index.html',
template: 'index.html',
inject: 'body',
hash: true
})
]
};
}),
new webpack.EnvironmentPlugin([
"NODE_ENV"
])
];
if(!debug){
plugins = plugins.concat([
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false})
])}
return plugins;
}