-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
47 lines (46 loc) · 1.26 KB
/
webpack.config.babel.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
// import paths from './gulp-paths';
import WebpackBar from 'webpackbar';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import webpack from 'webpack';
import path from 'path';
export default {
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name]-bundle.js',
},
entry: {
main: './src/client/main/index.jsx',
student: './src/client/student/index.jsx',
volunteer: './src/client/volunteer/index.jsx',
'licence-owner': './src/client/licence-owner/index.jsx',
},
devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-source-map',
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: [/node_modules/],
},
{
test: /\.(jpg|png|gif|otf|eot|ttf|woff\d?)$/,
loader: 'file-loader',
exclude: [/node_modules/],
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
plugins: (process.env.NODE_ENV === 'production'
? [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new UglifyJsPlugin(),
]
: [new WebpackBar()]
),
};