-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
47 lines (41 loc) · 928 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
47
'use strict'
const webpack = require("webpack");
const BowerWebpackPlugin = require("bower-webpack-plugin");
const NODE_ENV = process.env.NODE_ENV || 'dev';
module.exports = {
entry: "./src/index.js",
output: {
path: __dirname + '/dist',
filename: NODE_ENV == 'dev' ? "RadialBar.js" : "RadialBar.min.js",
library: "RadialBar"
},
watch: NODE_ENV == "dev",
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV == "dev" ? "source-map" : null,
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: "babel"
}]
},
plugins: [
new BowerWebpackPlugin({
modulesDirectories: ['bower_components'],
manifestFiles: ['bower.json'],
includes: /.*/,
excludes: /.*\.less$/
})
]
};
if(NODE_ENV == "production") {
module.exports.plugins.push(
new webpack.optimize.UglifyJsPlugin({
warnings: false,
drop_console: true,
unsafe: true
})
)
}