Skip to content

Commit 462789e

Browse files
committed
Add proxy path only in prod webpack config
1 parent 73f901d commit 462789e

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

configs/webpack.config.web.common.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import path from 'path';
55
import webpack from 'webpack';
6-
import HtmlWebpackPlugin from 'html-webpack-plugin';
76
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
87
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
98
import webpackPaths from './webpack.paths';
@@ -68,18 +67,7 @@ export default {
6867
'window.app.config.apiPort': JSON.stringify('5540'),
6968
}),
7069

71-
new HtmlWebpackPlugin({
72-
inject: 'head',
73-
isBrowser: false,
74-
isDevelopment: false,
75-
template: 'index.html.ejs',
76-
publicPath: '{{ RIPROXYPATH }}',
77-
}),
78-
79-
new MonacoWebpackPlugin({
80-
languages: ['json', 'javascript', 'typescript'],
81-
features: ['!rename'],
82-
}),
70+
new MonacoWebpackPlugin({ languages: ['json', 'javascript', 'typescript'], features: ['!rename'] }),
8371

8472
new webpack.IgnorePlugin({
8573
checkResource(resource) {

configs/webpack.config.web.dev.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import webpack from 'webpack';
1111
import { merge } from 'webpack-merge';
1212
import { toString } from 'lodash'
1313
import commonConfig from './webpack.config.web.common';
14+
import HtmlWebpackPlugin from 'html-webpack-plugin';
1415

1516
function employCache(loaders) {
1617
return ['cache-loader'].concat(loaders);
@@ -198,7 +199,10 @@ const configuration: webpack.Configuration = {
198199
new webpack.HotModuleReplacementPlugin({
199200
multiStep: true,
200201
}),
201-
202+
new HtmlWebpackPlugin({
203+
inject: 'head',
204+
template: 'index.html.ejs',
205+
}),
202206
new webpack.NoEmitOnErrorsPlugin(),
203207

204208
/**

configs/webpack.config.web.prod.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
88
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
99
import commonConfig from './webpack.config.web.common';
1010
import DeleteDistWeb from '../scripts/DeleteDistWeb';
11+
import HtmlWebpackPlugin from 'html-webpack-plugin';
1112

1213
DeleteDistWeb();
1314

@@ -72,6 +73,11 @@ const configuration: webpack.Configuration = {
7273
filename: '[name].[fullhash].css',
7374
chunkFilename: '[id].[fullhash].css',
7475
}),
76+
new HtmlWebpackPlugin({
77+
inject: 'head',
78+
template: 'index.html.ejs',
79+
publicPath: '{{ RIPROXYPATH }}',
80+
}),
7581

7682
new webpack.EnvironmentPlugin({
7783
NODE_ENV: 'production',

0 commit comments

Comments
 (0)