forked from DemocracyLab/CivicTechExchange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (34 loc) · 1.05 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
const path = require('path');
const webpack = require('webpack');
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
// TODO: Figure out how to move sass build in here instead of npm script for performance
module.exports = {
entry: "./common/components/mount-components.js",
target: 'web',
output: {
path: path.resolve(__dirname, "./common/static/js"),
filename: "bundle.js"
},
module: {
rules: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/ }
]
},
resolve: {
aliasFields: ['browser']
},
node: {
child_process: "empty",
fs: "empty",
tls: "empty"
},
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
'fs': 'empty'
}),
new ContextReplacementPlugin(/moment[\/\\]locale$/, /en/)
]
};