@@ -4,7 +4,6 @@ const webpack = require('webpack')
44const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
55const ManifestPlugin = require ( 'webpack-manifest-plugin' )
66const SWPrecacheWebpackPlugin = require ( 'sw-precache-webpack-plugin' )
7- // const eslintFormatter = require('react-dev-utils/eslintFormatter')
87const ModuleScopePlugin = require ( 'react-dev-utils/ModuleScopePlugin' )
98const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
109const paths = require ( './paths' )
@@ -21,9 +20,6 @@ const env = getClientEnvironment(publicUrl)
2120if ( env . stringified [ 'process.env' ] . NODE_ENV !== '"production"' ) {
2221 throw new Error ( 'Production builds must have NODE_ENV=production.' )
2322}
24-
25- // const cssFilename = 'static/css/[name].[contenthash:8].css'
26-
2723// 优先体积
2824module . exports = {
2925 mode : 'production' ,
@@ -67,21 +63,6 @@ module.exports = {
6763 module : {
6864 strictExportPresence : true ,
6965 rules : [
70- // {
71- // test: /\.(js|jsx)$/,
72- // enforce: 'pre',
73- // use: [
74- // {
75- // options: {
76- // formatter: eslintFormatter,
77- // eslintPath: require.resolve('eslint'),
78-
79- // },
80- // loader: require.resolve('eslint-loader'),
81- // },
82- // ],
83- // include: paths.appSrc,
84- // },
8566 {
8667 oneOf : [
8768 {
@@ -180,27 +161,6 @@ module.exports = {
180161 } ,
181162 ] ,
182163 } ,
183- // optimization: {
184- // cacheGroups: {
185- // vendor1: {
186- // chunks: 'all',
187- // test: /[\\/]node_modules[\\/](react|react-dom|antd)[\\/]/,
188- // name: 'vendor1',
189- // maxAsyncRequests: 5,
190- // priority: 10,
191- // enforce: true,
192- // },
193- // vendor2: {
194- // chunks: 'all',
195- // test: /[\\/]node_modules[\\/]/,
196- // name: 'vendor2',
197- // maxAsyncRequests: 5,
198- // priority: 9,
199- // enforce: true,
200- // reuseExistingChunk: true,
201- // },
202- // },
203- // },
204164 plugins : [
205165 new HtmlWebpackPlugin ( {
206166 inject : true ,
@@ -218,7 +178,9 @@ module.exports = {
218178 minifyURLs : true ,
219179 } ,
220180 } ) ,
221- new webpack . DefinePlugin ( env . stringified ) ,
181+ new webpack . DefinePlugin ( Object . assign ( { } , env . stringified , {
182+ ENABLE_DEVTOOLS : false ,
183+ } ) ) ,
222184 // Generate a manifest file which contains a mapping of all asset filenames
223185 // to their corresponding output file so that tools can pick it up without
224186 // having to parse `index.html`.
@@ -239,7 +201,6 @@ module.exports = {
239201 if ( message . indexOf ( 'Skipping static resource' ) === 0 ) {
240202 return
241203 }
242- console . log ( message )
243204 } ,
244205 minify : true ,
245206 // For unknown URLs, fallback to the index page
0 commit comments