forked from wonky-mongoose/wonky-mongoose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (41 loc) · 1019 Bytes
/
webpack.config.js
File metadata and controls
42 lines (41 loc) · 1019 Bytes
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
const isDev = process.env.NODE_ENV !== 'production';
const webpack = require('webpack');
const path = require('path');
module.exports = {
context: path.join(__dirname, 'src'),
devtool: isDev ? 'inline-sourcemap' : null,
entry: './client/app.js',
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
},
{
test: /\.json$/,
loader: 'json',
},
],
},
output: {
path: path.join(__dirname, `/${isDev ? 'dev' : 'dist'}/client/`),
filename: 'app.js',
},
plugins: isDev ? [] : [
new webpack.EnvironmentPlugin(['NODE_ENV', 'PROTOCOL', 'HOST', 'PORT']),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
mangle: false,
sourcemap: false,
}),
],
};