-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (44 loc) · 1 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
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'build');
const APP_DIR = path.resolve(__dirname, 'src/');
const config = {
entry: [
APP_DIR + '/index.jsx',
],
output: {
path: BUILD_DIR,
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.jsx?/,
include: APP_DIR,
loader: 'babel',
},
{
test: /\.scss$/,
loaders: ['style', 'css?sourceMap', 'sass?sourceMap'],
},
{ test: /\.css$/,
loader: 'style-loader!css-loader',
},
],
},
sassLoader: {
includePaths: [path.resolve(APP_DIR, './scss')],
},
devServer: {
contentBase: './build',
hot: true,
inline: true,
open: true,
proxy: [{
path: /\/api(.*)/, // any call to a url with api will be forwarded to your backend server
target: '', // insert your backend server url here
rewrite: (req) => {req.url = req.url.substring(4);},
secure: false,
}],
},
};
module.exports = config;