forked from clappr/clappr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (28 loc) · 906 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
/* eslint-disable no-var */
var path = require('path')
var webpack = require('webpack')
var Clean = require('clean-webpack-plugin')
var webpackConfig = require('./webpack-base-config')
webpackConfig.entry = path.resolve(__dirname, 'src/main.js')
if (process.env.npm_lifecycle_event === 'release') {
webpackConfig.plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true, debug: false }))
webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: true,
sourceMap: true,
comments: false,
output: {comments: false}
})
)
} else if (process.env.npm_lifecycle_event !== 'start') {
webpackConfig.plugins.push(new Clean(['dist'], {verbose: false}))
}
webpackConfig.output = {
path: path.resolve(__dirname, 'dist'),
filename: 'clappr.js',
library: 'Clappr',
libraryTarget: 'umd'
}
module.exports = webpackConfig