-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
64 lines (45 loc) · 1.08 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const webpack = require('webpack');
const path = require('path');
const dir_src = path.resolve(__dirname, 'src');
const dir_build = path.resolve(__dirname, 'dist');
const output = 'cipherjs';
const config = {
// Source JS file
entry: path.resolve(dir_src, 'index.js'),
// Build Destination File
output: {
path: dir_build,
filename: output + '.min.js'
},
// Module Loaders
module: {
loaders: [
{
// Use babel against all project js files
loader: 'babel-loader',
test: /(\.js)$/,
exclude: /node_modules/,
// Support the last 5 browser versions
options: {
presets: [['env', {
targets: {
node: 'current',
browsers: 'last 5 versions'
}
}]]
}
}
]
},
plugins: [
// Uglify Builds
new webpack.optimize.UglifyJsPlugin(),
// Don't build when compilation fails
new webpack.NoEmitOnErrorsPlugin()
],
stats: {
// Nice colorful outputs
colors: true
}
};
module.exports = config;