-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
51 lines (48 loc) · 1020 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
42
43
44
45
46
47
48
49
50
51
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname);
const APP_DIR = path.resolve(__dirname, 'src');
const config = {
devtool: 'source-map',
entry: `${APP_DIR}/app.jsx`,
output: {
path: BUILD_DIR,
publicPath: '/public/build/',
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre',
},
{
test: /\.jsx?$/,
include: APP_DIR,
loader: 'babel-loader',
},
{
test: /\.svg$/,
loader: 'svg-react-loader?name=Icon',
},
],
},
plugins: [
new webpack.EnvironmentPlugin({
ABE_URL: 'http://localhost:3000/',
CLIENT_ID: null,
DEBUG: true,
GA_ID: null,
OAUTH_AUTH_ENDPOINT: null,
}),
],
devServer: {
contentBase: ['./public', '.'],
historyApiFallback: true,
},
resolve: {
extensions: ['.js', '.jsx'],
},
};
module.exports = config;