-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.production.config.js
64 lines (58 loc) · 1.26 KB
/
webpack.production.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
/* eslint-disable */
var path = require('path'),
webpack = require('webpack'),
autoprefixer = require('autoprefixer'),
uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
module.exports = {
entry: [
path.resolve(__dirname, 'src/app.jsx'),
],
output: {
path: __dirname,
filename: './dist/bundle.js',
},
module: {
loaders: [
{
// JSX files :
test: /\.js[x]?$/,
include: path.resolve(__dirname, 'src'),
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react',
},
{
// CSS files :
test: /\.css?$/,
include: path.resolve(__dirname, 'src'),
loader: 'style-loader!css-loader!postcss-loader',
},
{
// SCSS files :
test: /\.scss?$/,
include: path.resolve(__dirname, 'src'),
loader: 'style-loader!css-loader!postcss-loader!sass',
},
],
},
postcss: [
autoprefixer({ browsers: ['last 3 versions'] }),
],
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
new uglifyJsPlugin({
compress: {
warnings: false
}
}),
],
// Create Sourcemaps for the bundle
devtool: 'source-map',
};