refactor: dev optimizations

This commit is contained in:
NGPixel
2018-01-27 21:40:51 -05:00
parent 9e7f6b6eb1
commit 63902907b5
9 changed files with 612 additions and 438 deletions

View File

@@ -5,6 +5,7 @@ const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ProgressBarPlugin = require('progress-bar-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const NameAllModulesPlugin = require('name-all-modules-plugin')
const babelConfig = fs.readJsonSync(path.join(process.cwd(), '.babelrc'))
const postCSSConfig = {
@@ -182,6 +183,13 @@ module.exports = {
{ from: 'client/static' }
], {
}),
new webpack.NamedModulesPlugin(),
new webpack.NamedChunksPlugin((chunk) => {
if (chunk.name) {
return chunk.name
}
return chunk.modules.map(m => path.relative(m.context, m.request)).join('_')
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
@@ -190,9 +198,10 @@ module.exports = {
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
name: 'runtime',
minChunks: Infinity
})
}),
new NameAllModulesPlugin()
],
resolve: {
symlinks: true,