competitions
杨树明 5 years ago
parent e453701805
commit 3e0fc0c4d0

@ -11,6 +11,7 @@ const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');
@ -61,16 +62,9 @@ module.exports = {
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: false,//测试版
devtool:false,//测试版
// In production, we only want to load the polyfills and the app code.
// entry: [require.resolve('./polyfills'), paths.appIndexJs],
entry: {
main:[require.resolve('./polyfills'), paths.appIndexJs],
vendor: [
'moment', 'react', 'react-dom','react-router-dom','react-router','antd','@icedesign/base','@novnc/novnc','axios',
'material-ui','echarts','qs',
],
},
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
// The build folder.
path: paths.appBuild,
@ -275,36 +269,6 @@ module.exports = {
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw),
new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.DedupePlugin(),
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({
name: ['vendor'],
filename: '[name].js',
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
children: true,
async: 'children-async'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: Infinity,
}),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
@ -353,9 +317,8 @@ module.exports = {
cacheDir: '.cache/',
uglifyJS:{
output: {
comments: false,
comments: false
},
warnings: false,
compress: {
drop_debugger: true,
drop_console: true
@ -419,4 +382,3 @@ module.exports = {
child_process: 'empty',
},
};

Loading…
Cancel
Save