-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
63 lines (54 loc) · 1.2 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
// -- awesome webpack... :)
var webpack = require('webpack');
// -- import some fs util libs
var path = require('path');
module.exports = {
// entry point
entry: {
GlobEntryPlugin: 'GlobEntryPlugin'
},
// define project context (sources)
context: path.join(__dirname, 'src'),
// output definition
output: {
filename: '[name].js',
library: 'GlobEntryPlugin',
libraryTarget: 'commonjs2',
path: path.join(__dirname, 'dist')
},
// this module/lib is to be executed
// in a node.js environment
target: 'node',
// tell webpack not to include
// this modules into be bundle
// (they are external dependencies)
externals: {
'glob': true,
'webpack/lib/MultiEntryPlugin': true,
'webpack/lib/SingleEntryPlugin': true
},
// setup plugins
plugins: [
new webpack.optimize.UglifyJsPlugin({
mangle: false,
comments: false,
sourceMap: false
})
],
// loaders definitions
module: {
loaders: [
// transpiles ES6 into vanilla ES5 code
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: [ 'ng-annotate', 'babel?stage=1' ]
}
]
},
// resolver definitions
resolve: {
root: path.join(__dirname, 'src'),
modulesDirectories: ['node_modules']
}
}