/
webpackConfig.jsx
48 lines (47 loc) · 1.03 KB
/
webpackConfig.jsx
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
import webpack from 'webpack';
import babelConfig from './config/babel';
const webpackConfig = (env) => ({
target: 'web',
debug: env === 'prod',
devtool: 'eval',
module: {
noParse: ['/^fb$/'],
loaders: [
{
test: /\.json$/,
exclude: /node_modules/,
loader: 'json-loader',
},
{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
ignore: ['node_modules', 'dist'],
plugins: babelConfig.browser[env].plugins,
},
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
},
}),
new webpack.ProvidePlugin({
'Promise': 'bluebird',
}),
new webpack.optimize.DedupePlugin(),
],
node: {
console: true,
fs: 'empty',
net: 'empty',
tls: 'empty',
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
});
export default webpackConfig;