-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
62 lines (55 loc) · 1.34 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client?reload=true',
'react-hot-loader/patch',
'eventsource-polyfill',
'./src/index',
],
output: {
path: path.join(__dirname, 'public'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
{ test: /\.js?$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{ test: /\.css?$/,
loader: ['css-loader'],
},
{ test: /\.scss?$/,
loader: ['style-loader', 'css-loader', 'sass-loader'],
},
{ test: /\.(jpg|gif|png|svg)$/,
loader: 'file-loader',
},
{ test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader'
},
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml'
},
]
},
devServer: {
// allow cross origin requests
headers: { "Access-Control-Allow-Origin": "*" },
host: 'localhost',
port: 5000,
public:'localhost:5000',
historyApiFallback: true,
// respond to 404s with index.html
hot: true,
// enable HMR on the server
},
};