From c6c175e0633dee167eb2f297b914d6a4e6648d73 Mon Sep 17 00:00:00 2001 From: hanbowen01 Date: Fri, 15 Sep 2023 14:55:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(dev):=20=E4=BF=AE=E5=A4=8Dwebpack=E4=B8=8B-?= =?UTF-8?q?-host=E5=8F=82=E6=95=B0=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli-dev/src/webpack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli-dev/src/webpack.ts b/packages/cli-dev/src/webpack.ts index f86b1d17..c9e8d79d 100644 --- a/packages/cli-dev/src/webpack.ts +++ b/packages/cli-dev/src/webpack.ts @@ -24,7 +24,7 @@ export const startServer = async (server: WebpackDevServer): Promise => { }; export const start = async (cmd: DevCommandLineArgs, serverContext: WebpackServerStartContext) => { - const {buildContext, host} = serverContext; + const {buildContext, host, publicPath} = serverContext; const {hot, https} = buildContext.projectSettings.devServer; const extra = await createWebpackDevServerPartial(buildContext, host); const config = await createWebpackConfig( @@ -35,7 +35,7 @@ export const start = async (cmd: DevCommandLineArgs, serverContext: WebpackServe caseSensitiveModuleSource: cmd.strict, typeCheck: false, }, - extras: [extra], + extras: [extra, {output: {publicPath}}], } ); const devServerConfig = await createWebpackDevServerConfig(