-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
60 lines (58 loc) · 1.25 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path'),
webpack = require('webpack');
const PROD = JSON.parse(process.env.PROD_ENV || '0');
let plugins;
if (PROD) {
plugins = [
new webpack.optimize.UglifyJsPlugin({minimize: true})
];
} else {
plugins = [];
}
module.exports = {
entry: {
admin: './web/src/admin/index.js',
client: './web/src/client/index.js',
authentication: './web/src/admin/authentication.js'
},
output: {
filename: '[name]_bundle.js',
path: path.resolve(__dirname, 'web/static')
},
devServer: {
contentBase: './templates',
historyApiFallback: true,
inline: true
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}, {
test: /\.(png|jpg|gif)$/,
loader: 'file-loader?name=img/[name].[ext]'
}, {
test: /\.(scss|css)$/,
use: [{
loader: "style-loader"
}, {
loader: "css-loader"
}, {
loader: "sass-loader"
}]
}, {
test: /\.(eot|woff|woff2|svg|ttf)([\?]?.*)$/,
loader: "file-loader"
}]
},
stats: {
colors: true
},
devtool: 'source-map',
plugins: plugins,
};