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:
@@ -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(),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user