-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathwebpack.config.js
More file actions
64 lines (59 loc) · 1.23 KB
/
webpack.config.js
File metadata and controls
64 lines (59 loc) · 1.23 KB
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
var webpack = require('webpack');
var path = require('path');
// Detect environment
var isProduction = process.env.NODE_ENV === 'production';
// Create config
var config = {
entry: {
'dist/sententree.js': './src/main.js'
},
output: {
library: 'SentenTree',
libraryTarget: 'umd',
path: __dirname,
filename: '[name]'
},
externals: [{
'd3': true,
'd3kit': {
amd: 'd3kit',
commonjs: 'd3kit',
commonjs2: 'd3kit',
root: 'd3Kit',
},
'heap': {
amd: 'heap',
commonjs: 'heap',
commonjs2: 'heap',
root: 'Heap',
},
'lodash': {
amd: 'lodash',
commonjs: 'lodash',
commonjs2: 'lodash',
root: '_',
},
'webcola/WebCola/cola.js': {
amd: 'webcola/WebCola/cola.js',
commonjs: 'webcola/WebCola/cola.js',
commonjs2: 'webcola/WebCola/cola.js',
root: 'cola',
},
}],
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-object-assign']
}
}
]
},
plugins: [],
devtool: isProduction ? undefined : 'eval'
};
module.exports = config;