forked from hatedMe/wechat-request
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
51 lines (45 loc) · 960 Bytes
/
webpack.prod.js
File metadata and controls
51 lines (45 loc) · 960 Bytes
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
44
45
46
47
48
49
50
51
const webpack = require('webpack');
const path = require('path');
/*
* We've enabled UglifyJSPlugin for you! This minifies your app
* in order to load faster and run less javascript.
*
* https://github.com/webpack-contrib/uglifyjs-webpack-plugin
*
*/
// production
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './index.js',
output: {
// library: 'wxRequest',
libraryTarget: 'umd',
umdNamedDefine: true ,
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
devtool : 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['env'],
plugins : 'transform-es2015-modules-commonjs'
}
}
]
},
plugins: [
new UglifyJSPlugin(),
new webpack.BannerPlugin(
`
author : 7548764@qq.com
github : https://github.com/hatedMe/wechat-request
version : 1.4.2
`
)
]
};