-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
55 lines (53 loc) · 1.42 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
mode: 'development',
entry: "./src/bookmark/index.js",
output: {
path: path.resolve(__dirname, './dist/js/'),
publicPath: '/dist/js/',
filename: 'bh-render.js',
library: 'bh-render',
libraryTarget: 'umd',
libraryExport: 'default',
umdNamedDefine: true,
globalObject: 'typeof self !== \'undefined\' ? self : this'
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}]
},
// devtool: "source-map",
resolve: {
alias: {
'vue': 'vue/dist/vue.js'
}
},
plugins: [
new VueLoaderPlugin(),
new UglifyJsPlugin({
sourceMap: false,
uglifyOptions: {
compress: {
// 删除所有的 `console` 语句
drop_console: true,
},
output: {
// 最紧凑的输出
beautify: false,
// 删除所有的注释
comments: false,
},
}
})
],
// optimization: {
// minimizer: []
// }
}