forked from canonical/maas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
51 lines (49 loc) · 1.79 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
const glob = require('glob');
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: {
vendor: [].concat(
glob.sync('./src/maasserver/static/js/angular/3rdparty/*.js')
),
maas: ['babel-polyfill', 'macaroon-bakery'].concat(
glob.sync('./src/maasserver/static/js/*.js'),
glob.sync('./src/maasserver/static/js/ui/*.js'),
glob.sync('./src/maasserver/static/js/angular/*.js'),
glob.sync('./src/maasserver/static/js/angular/controllers/*.js'),
glob.sync('./src/maasserver/static/js/angular/directives/*.js'),
glob.sync('./src/maasserver/static/js/angular/directives/nodedetails/*.js'),
glob.sync('./src/maasserver/static/js/angular/directives/nodelist/*.js'),
glob.sync('./src/maasserver/static/js/angular/filters/*.js'),
glob.sync('./src/maasserver/static/js/angular/services/*.js'),
glob.sync('./src/maasserver/static/js/angular/factories/*.js')
)
},
mode: 'development',
// This creates a .map file for debugging each bundle.
devtool: 'source-map',
plugins: [
new UglifyJSPlugin({
parallel: true,
cache: true,
sourceMap: true,
uglifyOptions: {
// Using the 'mangle' option breaks the Angular injector.
mangle: false
}
})
],
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-es2015', '@babel/preset-react']
}
}]
},
output: {
path: path.resolve(__dirname, 'src/maasserver/static/js/bundle'),
filename: '[name]-min.js'
}
};