How to use the prod function from webpack

Find comprehensive JavaScript webpack.prod code examples handpicked from public code repositorys.

120
121
122
123
124
125
126
127
128
129
  test: /\.svg$/i,
  issuer: /\.[jt]sx?$/,
  use: [{ loader: '@svgr/webpack', options: { icon: true } }]
},
// {
//   test: /\.(svg)(\?.*)?$/, // for reducing file-size: OptimizeCSSAssetsPlugin > cssnano > SVGO, that congigured in webpack.prod.js
//   exclude: /(fonts\\.+\.svg)(\?.*)?/,
//   type: "asset",
//   generator: {
//     filename: "images/[name][ext][query]", // [hash][ext][query]",
fork icon0
star icon0
watch icon0

+ 7 other calls in file

12
13
14
15
16
17
18
19
20
21
```sh
└── static # 项目静态文件目录
    ├── build
    │   ├── webpack.base.config.js # 基础编译脚本
    │   ├── webpack.dev.config.js # 开发环境编译脚本
    │   └── webpack.prod.config.js # 生产环境编译脚本
    ├── output # 编译后输出目录
    │   ├── asset
    │   ├── dist
    │   └── upload
fork icon0
star icon0
watch icon181

+ 3 other calls in file