forked from wilzbach/msa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
50 lines (48 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
var path = require('path');
var webpack = require('webpack');
var prod = process.argv.indexOf('-p') >= 0;
module.exports = {
entry: './src/index_webpack.js',
output: {
path: __dirname,
filename: 'dist/msa.js'
},
module: {
loaders: [
{ test: /\.js?$/,
loader: 'babel-loader'
},
{ test: /\.css$/,
loader: "style-loader!css-loader" }
],
},
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
MSA_VERSION: JSON.stringify(require("./package.json").version)
}),
],
// require other ES6 files (experimental)
resolve: {
root: path.resolve(__dirname),
alias: {
"bio.io": 'node_modules/bio.io/src/index'
}
},
};
var w = module.exports;
// only executed with -p
if(prod) {
w.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
collapse_vars: true
},
sourceMap: true
}));
var WebpackStrip = require('strip-loader');
w.module.loaders.push(
{ test: path.join(__dirname, 'src'),
loader: WebpackStrip.loader('console.log') }
);
}