forked from vkbansal/react-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexamples.config.js
72 lines (65 loc) · 1.81 KB
/
examples.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
/* eslint-disable */
const webpack = require('webpack');
const path = require('path');
const PROD = process.env.NODE_ENV === 'production';
const config = {
entry: ["./examples/index.js"],
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "./examples"),
publicPath: "/",
sourceMapFilename: "bundle.js.map"
},
resolve: {
modules: [
path.resolve(__dirname),
'node_modules'
]
},
module: {
rules: [
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: {
presets: [
'react',
['env', {
modules: false,
targets: {
browsers: 'IE >= 11, Edge >= 12, FireFox >= 38, Chrome >= 47, Opera >= 34, Safari >= 8'
}
}],
'babili'
],
plugins: [
'transform-class-properties'
]
}
}],
include: [
path.resolve(__dirname, './src'),
path.resolve(__dirname, './examples')
]
}
]
},
plugins: []
};
!PROD && (config.devtool = "source-map");
PROD && config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false,
}
})
);
PROD && config.plugins.push(
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify("production")
}
})
);
module.exports = config;