-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathwebpack.dev.js
52 lines (49 loc) · 1.99 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
// Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
const common = require('./webpack.common');
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const serviceUrl = process.env.SERVICE_URL || 'http://localhost:5000';
module.exports = {
...common,
mode: 'development',
devtool: 'inline-source-map',
output: {
filename: 'report_bundle.js',
path: path.resolve(__dirname, 'devel'),
publicPath: '/',
},
plugins: [
...common.plugins,
new MiniCssExtractPlugin({
filename: 'report_style.css',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.SERVICE_URL': JSON.stringify(process.env.SERVICE_URL),
}),
new webpack.HotModuleReplacementPlugin(),
],
devServer: {
compress: true,
hot: true,
open: "index_report.html",
port: 5010,
proxy: {
'/api': {
target: serviceUrl,
secure: false
}
},
static: {
directory: path.join(__dirname, 'public'),
},
historyApiFallback: true
},
performance: {
// TODO: Find and remove orphan modules; Reduce bundle size.
hints: 'warning', // 'error' for errors, 'warning' for warnings, false to disable
maxAssetSize: 7100000, // Size limit in bytes, default is 250000 (250 KB)
maxEntrypointSize: 7100000, // Size limit in bytes, default is 250000 (250 KB)
},
};