Update web-starter
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
|
||||
const outputPrefix = '[chunkhash:8]-'
|
||||
const WebpackMD5Hash = require('webpack-md5-hash')
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
vendor: [ 'react' ],
|
||||
vendor: [ 'react', 'react-dom' ],
|
||||
home: path.resolve(__dirname, 'modules/client/home.js')
|
||||
},
|
||||
|
||||
output: {
|
||||
filename: `${outputPrefix}[name].js`,
|
||||
filename: '[chunkhash:8]-[name].js',
|
||||
path: path.resolve(__dirname, 'public/__assets__'),
|
||||
publicPath: '/__assets__/'
|
||||
},
|
||||
@ -28,12 +28,20 @@ module.exports = {
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor' }),
|
||||
new ExtractTextPlugin(`${outputPrefix}styles.css`),
|
||||
new WebpackMD5Hash(),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
new ChunkManifestPlugin({
|
||||
filename: 'chunk-manifest.json',
|
||||
manifestVariable: 'webpackManifest'
|
||||
}),
|
||||
new ExtractTextPlugin('[chunkhash:8]-styles.css'),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
|
||||
})
|
||||
}),
|
||||
new webpack.optimize.OccurrenceOrderPlugin()
|
||||
],
|
||||
|
||||
postcss: () => [ autoprefixer ]
|
||||
|
Reference in New Issue
Block a user