-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (41 loc) · 945 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
44
45
46
'use strict'
var webpack = require('webpack')
module.exports = function (env) {
var isMinifiedBuild = (env === 'min')
var filename = (isMinifiedBuild)
? 'incremental-hyperscript.min.js'
: 'incremental-hyperscript.js'
var plugins
if (isMinifiedBuild) {
plugins = [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
})
]
} else {
plugins = []
}
return {
entry: './src/incremental-hyperscript.js',
devtool: 'source-map',
output: {
path: './dist',
filename: filename,
library: 'IncrementalHyperscript',
libraryTarget: 'umd'
},
externals: {
'incremental-dom': {
commonjs: 'incremental-dom',
commonjs2: 'incremental-dom',
amd: 'incremental-dom',
root: 'IncrementalDOM'
}
},
plugins: plugins
}
}