competitions
杨树明 6 years ago
parent 9bc8c91d38
commit e453701805

@ -67,8 +67,8 @@ module.exports = {
entry: { entry: {
main:[require.resolve('./polyfills'), paths.appIndexJs], main:[require.resolve('./polyfills'), paths.appIndexJs],
vendor: [ vendor: [
'moment', 'react', 'react-dom','react-router-dom','antd','@icedesign/base','@novnc/novnc','array-flatten','axios', 'moment', 'react', 'react-dom','react-router-dom','react-router','antd','@icedesign/base','@novnc/novnc','axios',
'material-ui','monaco-editor','react-monaco-editor', 'echarts',"qs" 'material-ui','echarts','qs',
], ],
}, },
output: { output: {
@ -276,29 +276,35 @@ module.exports = {
// in `package.json`, in which case it will be the pathname of that URL. // in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw), new InterpolateHtmlPlugin(env.raw),
new webpack.HashedModuleIdsPlugin(), new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
// new webpack.optimize.ModuleConcatenationPlugin(), // new webpack.optimize.CommonsChunkPlugin({
// async: 'async-vendor',
// deepChildren: true,
// minChunks: (module) => {
// return /node_modules/.test(module.context);
// },
// }),
// new webpack.optimize.CommonsChunkPlugin(
// {names: 'vendor'}
// ),
//
new webpack.optimize.CommonsChunkPlugin({ new webpack.optimize.CommonsChunkPlugin({
async: 'async-vendor', name: ['vendor'],
deepChildren: true, filename: '[name].js',
minChunks: (module) => { minChunks: Infinity
return /node_modules/.test(module.context); }),
}, new webpack.optimize.CommonsChunkPlugin({
children: true,
async: 'children-async'
}), }),
new webpack.optimize.CommonsChunkPlugin(
{names: ["vendors", "webpackAssets",'moment', 'react', 'react-dom','react-router-dom','antd','@icedesign/base','@novnc/novnc','array-flatten','axios',
'material-ui','monaco-editor','react-monaco-editor', 'echarts',"qs"]}
),
new webpack.optimize.CommonsChunkPlugin({ new webpack.optimize.CommonsChunkPlugin({
name: 'manifest', name: 'manifest',
minChunks: (module) => { chunks: Infinity,
return /node_modules/.test(module.context);
},
}), }),
// Generates an `index.html` file with the <script> injected. // Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: true, inject: true,
@ -347,8 +353,7 @@ module.exports = {
cacheDir: '.cache/', cacheDir: '.cache/',
uglifyJS:{ uglifyJS:{
output: { output: {
beautify: true, comments: false,
comments: true,
}, },
warnings: false, warnings: false,
compress: { compress: {

Loading…
Cancel
Save