diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index dd2d6e218..6d639e429 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -28,14 +28,14 @@ const prodWebpackConfig = merge(common, { new MiniCssExtractPlugin({ filename: 'static/css/[name].[contenthash].css', chunkFilename: 'static/css/[name].[contenthash].css', - ignoreOrder: true, + ignoreOrder: true }), new PurgeCSSPlugin({ paths: glob.sync(`${path.join(__dirname, 'src')}/**/*`, { nodir: true }), only: ['bundle', 'vendor', 'dist'], safelist: { - standard: [/^ant-/], - }, + standard: [/^ant-/] + } }), // new CompressionWebpackPlugin({ // filename: '[path][base].gz', @@ -51,11 +51,11 @@ const prodWebpackConfig = merge(common, { from: path.resolve(__dirname, '../public'), to: path.resolve(__dirname, '../dist'), globOptions: { - ignore: ['**/index.html'], - }, - }, - ], - }), + ignore: ['**/index.html'] + } + } + ] + }) ], optimization: { minimize: true, @@ -63,9 +63,9 @@ const prodWebpackConfig = merge(common, { new CssMinimizerPlugin(), new EsbuildPlugin({ target: 'es2015', - css: true, + css: true }), - new HtmlMinimizerPlugin(), + new HtmlMinimizerPlugin() ], splitChunks: { chunks: 'all', @@ -81,29 +81,29 @@ const prodWebpackConfig = merge(common, { minChunks: 1, priority: 10, enforce: true, - chunks: 'all', + chunks: 'all' }, react: { - test(module) { + test (module) { return module.resource && module.resource.includes('node_modules/react') }, chunks: 'initial', filename: 'react.[contenthash].js', priority: 1, maxInitialRequests: 2, - minChunks: 1, - }, - }, + minChunks: 1 + } + } }, runtimeChunk: { - name: 'runtime', - }, + name: 'runtime' + } }, performance: { hints: false, maxEntrypointSize: 512000, - maxAssetSize: 512000, - }, + maxAssetSize: 512000 + } }) module.exports = prodWebpackConfig