-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.js
56 lines (55 loc) · 1.68 KB
/
webpack.dev.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
52
53
54
55
56
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const path = require('path');
module.exports = merge(common, {
entry: './client/src/index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: 'http://localhost:8080/dist/'
},
mode: 'development',
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.(scss|sass|css)$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'fast-sass-loader'
]
},
{
test: /\.(js|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint')
},
loader: require.resolve('eslint-loader')
}
],
include: path.join(__dirname, 'client/src')
}
]
},
devServer: {
hot: true,
open: true,
port: 8081,
publicPath: 'http://localhost:8080/dist',
disableHostCheck: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods':
'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers':
'X-Requested-With, content-type, Authorization'
}
}
});