-
Notifications
You must be signed in to change notification settings - Fork 82
/
webpack.config.js
45 lines (43 loc) · 1.03 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
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack')
const libraryName = 'vue-masonry-plugin'
const buildTarget = process.env.TARGET === 'umd' ? 'umd' : 'window'
const outputFile = `${libraryName}-${buildTarget}.js`
const tagline = 'Vue.js plugin for Masonry layouts'
module.exports = {
entry: './index.js',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env']
}
}
]
},
output: {
path: __dirname + '/dist',
filename: outputFile,
library: libraryName,
libraryTarget: buildTarget,
umdNamedDefine: true
},
mode: 'production',
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
output: {comments: new RegExp(tagline, 'i')}
}
})
]
},
plugins: [
new webpack.BannerPlugin({
banner: `${tagline} \n https://github.com/shershen08/vue-masonry/ \n file:[file]`
})
]
}