-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.development.config.js
39 lines (38 loc) · 1.06 KB
/
webpack.development.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
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const publicUrl = './public';
const data = require('./src/data/sample.json');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
module.exports = merge.merge(common, {
output: {
publicPath: '/',
},
mode: 'development',
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000,
hot: true,
open: true,
writeToDisk: true,
overlay: {
errors: true,
},
headers: {
'Cache-Control': 'max-age=0',
get etag() {
return String(Math.random());
},
},
},
plugins: [
new InterpolateHtmlPlugin(HtmlWebPackPlugin, {
PUBLIC_URL: publicUrl,
TITLE: 'Test Title',
RESULTDATA: JSON.stringify(data),
}),
],
});