-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.dev.js
44 lines (43 loc) · 1.21 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
var config = require('./webpack.config')
var merge = require('webpack-merge')
var path = require('path')
var webpack = require('webpack')
module.exports = merge(config, {
mode: 'development',
entry: {
webpack: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server'
]
},
devServer: {
hot: true,
contentBase: path.resolve(__dirname, 'assets'), // eslint-disable-line no-undef
publicPath: '/',
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'
}
},
output: {
publicPath: 'http://localhost:8080/',
filename: '[name].js'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
module: {
rules: [
{
test: /\.s?css$/,
use: [
'style-loader',
'css-loader?importLoaders=1',
'sass-loader',
]
},
]
}
})