-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.prod.config.js
38 lines (37 loc) · 1.13 KB
/
webpack.prod.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path');
// 自定义NODE_ENV变量将其设置为生产模式
process.env.NODE_ENV = 'production';
module.exports = {
entry: './src/index.js',
mode: "production",
output: {
path: path.resolve(__dirname, 'dist'),
filename: "md-reverse.js"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: "> 0.25%, not dead",
corejs: 3,
useBuiltIns: "usage"
}
]
],
plugins: [
require('@babel/plugin-proposal-class-properties'),
]
}
}
}
]
}
};