forked from react-d3/react-d3-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (40 loc) · 1.13 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
'use strict';
var path = require('path'),
webpack = require('webpack'),
nodeModulesPath = path.join(__dirname, 'node_modules');
// 0 stands for development, 1 stands for production
// for development mode: NODE_ENV=0 webpack
// for production mode: NODE_ENV=1 webpack
var ENV = !!(+process.env.NODE_ENV || 0);
module.exports = [{
name: 'react-d3-map',
devtool: ENV ? "source-map": '',
entry: {
container: './example/src/container.jsx',
multipolygon: './example/src/multipolygon.jsx',
mapresponsive: './example/src/mapresponsive.jsx',
point: './example/src/point.jsx',
line: './example/src/line.jsx',
test: './example/src/test.jsx'
},
output: {
path: ENV ? path.join(__dirname, './example/min'): path.join(__dirname, './example/dist'),
filename: ENV ? '[name].min.js': '[name].js'
},
module: {
loaders: [
{
test: [/\.jsx$/, /\.js$/],
exclude: /node_modules/,
loaders: ["jsx-loader"],
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
],
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
}
}];