-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (38 loc) · 974 Bytes
/
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
var webpack = require('webpack');
var path = require('path');
var APP_DIR = path.resolve(__dirname, 'client');
var BUILD_DIR = path.resolve(__dirname, 'server/static/javascript');
var config = {
entry: APP_DIR + '/main.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js',
},
devtool: 'eval-source-map',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
include: APP_DIR,
loader: 'babel-loader',
options: {
babelrc: false,
presets: ['env', 'react', 'stage-2'],
},
},
{
test: /\.css$/,
loader: ['style-loader', 'css-loader'],
},
],
},
plugins: [
new webpack.DefinePlugin({
'NODE_ENV': JSON.stringify(process.env.LOCATION),
'GITHUB_CLIENT_ID': JSON.stringify(process.env.GITHUB_CLIENT_ID),
'SERVER_NAME': JSON.stringify(process.env.SERVER_NAME),
}),
],
};
module.exports = config;