File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 1+ const { merge } = require ( "webpack-merge" ) ;
2+ const common = require ( "./webpack.common" ) ;
3+ const path = require ( "path" ) ;
4+ const TerserPlugin = require ( "terser-webpack-plugin" ) ;
5+
6+ module . exports = merge ( common , {
7+ mode : "production" ,
8+ devtool : "cheap-module-source-map" ,
9+ output : {
10+ filename : "[name].[contenthash].js" ,
11+ path : path . resolve ( __dirname , "../dist" ) ,
12+ publicPath : "./" ,
13+ clean : true ,
14+ } ,
15+ optimization : {
16+ usedExports : true ,
17+ minimize : true ,
18+ minimizer : [
19+ new TerserPlugin ( {
20+ terserOptions : {
21+ compress : {
22+ drop_console : true ,
23+ } ,
24+ } ,
25+ } ) ,
26+ ] ,
27+ splitChunks : {
28+ chunks : "all" ,
29+ } ,
30+ } ,
31+ performance : {
32+ hints : false ,
33+ maxEntrypointSize : 512000 ,
34+ maxAssetSize : 512000 ,
35+ } ,
36+ } ) ;
Original file line number Diff line number Diff line change 55 "main" : " index.tsx" ,
66 "scripts" : {
77 "dev" : " webpack-dev-server --config config/webpack.dev.js" ,
8- "build" : " webpack --mode production" ,
9- "prestart" : " npm build" ,
10- "start" : " webpack --mode development"
8+ "build" : " webpack --config config/webpack.prod.js"
119 },
1210 "repository" : {
1311 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments