-
Notifications
You must be signed in to change notification settings - Fork 28
/
webpack.config.js
47 lines (45 loc) · 979 Bytes
/
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
/* eslint import/no-extraneous-dependencies: ["error", { "devDependencies": true }]*/
const webpack = require('webpack');
module.exports = {
entry: './app/index',
output: {
filename: 'bundle.js',
path: __dirname,
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({
comments: false,
compressor: {
warnings: false,
},
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'false',
}),
],
resolve: {
extensions: ['.js'],
},
module: {
rules: [
{
test: /\.js$/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['react'],
},
},
],
exclude: /node_modules/,
},
{
test: /\.css/,
loaders: ['style-loader', 'css-loader'],
},
],
},
};