-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.config.js
42 lines (41 loc) · 1.17 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
const path = require('path')
const is_production = process.env.NODE_ENV === "production"
module.exports = {
entry : {
index: './src/js/index.js'
},
cache : true,
output : {
path : path.join(__dirname, './dist/'),
filename : '[name].js',
libraryTarget: "umd"
},
//uncomment the devtool key for development so that webpack will provide a map to your source
devtool : is_production ? false : '#inline-source-map',
module : {
rules : [
{
test : /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets : [
['env', {
targets : {
ie : 9
}
}]
]
}
},
{
test: /\.mustache|html$/,
loader: 'mustache-loader'
}
]
},
//Since jQuery is a peer-dependency, we leave it here as an external
externals: {
"jquery": "jquery"
}
}