-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
43 lines (42 loc) · 956 Bytes
/
webpack.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
39
40
41
42
43
const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
entry: {
'hi-request.min': './src/index.ts',
index: './src/index.ts',
axios: './src/axios.ts',
download: './src/download.ts',
jsonp: './src/jsonp.ts',
mixin: './src/mixin.ts',
type: './src/type.ts',
upload: './src/upload.ts',
utils: './src/utils.ts'
},
output: {
filename: '[name].js',
library: 'HiRequest',
libraryTarget: 'umd',
libraryExport: 'default'
},
module: {
rules: [{ test: /\.ts$/, exclude: /node_modules/, use: ['ts-loader'] }]
},
//配置模块化引入文件的缺省类型
resolve: {
extensions: ['.js', '.ts']
},
mode: 'none',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false
}
},
extractComments: false,
include: /\.min\.js$/
})
]
}
}