-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.js
66 lines (64 loc) · 1.56 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: './src/index.js',
watch: true,
resolve: {
alias: {
"ag-grid-root" : __dirname + "/node_modules/ag-grid/dist/styles"
},
extensions: ['', '.js', '.jsx']
},
output: {
path: 'dist',
filename: 'bundle.js',
publicPath: ''
},
plugins: process.env.NODE_ENV === 'production' ? [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
}
})
] : [],
externals: {
"ZoomdataSDK": "ZoomdataSDK"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react'
},
{
test: /\.jsx$/,
include: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react'
},
{
test: /\.css$/,
loader: 'style!css',
include: /node_modules/
},
{
test: /\.css$/,
loader: 'style!css-loader',
exclude: /node_modules/
},
{
test: /\.(svg|gif|png|jpg)$/,
loader: 'url-loader?limit=20000&name=images/[name]-[hash].[ext]',
exclude: /node_modules/
}
],
noParse: [
/[\/\\]node_modules[\/\\]zoomdata-client[\/\\]distribute[\/\\]sdk[\/\\]zoomdata-client\.js$/
]
}
}