forked from cBioPortal/cbioportal-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vendor-bundles.webpack.config.js
78 lines (57 loc) · 1.93 KB
/
vendor-bundles.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"use strict";
/* eslint-disable */
let webpack = require('webpack');
const path = require('path');
let config = {
entry: {
// create two library bundles, one with jQuery and
// another with Angular and related libraries
common: ['jquery','imports-loader?jquery=jquery!jquery-migrate', 'react', 'react-dom', 'react-redux', 'react-bootstrap', 'seamless-immutable', 'lodash',
'mobx', 'mobx-react', 'chart.js', 'victory', 'react-select', 'react-rangeslider', 'mobx-react-devtools', 'mobx-utils', 'd3', 'datatables.net', 'webpack-raphael']
},
module: {
loaders: [
{ test: /lodash/, loader: 'imports-loader?define=>false'}
]
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'common-dist'),
// The name of the global variable which the library's
// require() function will be assigned to
library: '[name]_lib',
},
devtool : 'source-map',
plugins: [
],
devtool : 'source-map'
};
config.plugins = [
new webpack.DllPlugin({
// The path to the manifest file which maps between
// modules included in a bundle and the internal IDs
// within that bundle
path: 'common-dist/[name]-manifest.json',
// The name of the global variable which the library's
// require function has been assigned to. This must match the
// output.library option above
name: '[name]_lib'
}),
new webpack.DefinePlugin({
'process.env':{
'NODE_ENV': `"${process.env.NODE_ENV || 'production'}"`
}
})
];
if (process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== "test") {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap:true,
comments:false
})
)
}
module.exports = config;