1
0
mirror of https://github.com/mgerb/react-starter synced 2026-03-05 06:15:24 +00:00

upgrade to webpack 4 - complete overhaul

This commit is contained in:
2018-03-19 22:19:48 -05:00
parent f4b5cd04a5
commit 85d8a4d76b
22 changed files with 11134 additions and 5818 deletions

View File

@@ -7,7 +7,6 @@ const webpack = require('webpack');
module.exports = {
entry: {
app: './app/app.tsx',
vendor: ['react', 'react-dom'],
},
output: {
path: path.resolve(__dirname, 'dist'),
@@ -47,12 +46,18 @@ module.exports = {
loader: 'file-loader',
options: {
name: 'static/[name].[hash].[ext]',
}
},
},
],
},
],
},
optimization: {
occurrenceOrder: true,
splitChunks: {
chunks: 'all',
},
},
plugins: [
new CleanWebpackPlugin(['dist'], {
verbose: true,
@@ -60,16 +65,12 @@ module.exports = {
new ExtractTextPlugin({
filename: '[name].[hash].css',
disable: false,
allChunks: true
allChunks: true,
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './index.html',
}),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'manifest'],
minChunks: 'Infinity',
}),
new webpack.HotModuleReplacementPlugin(),
],
};