Skip to content

Commit

Permalink
fix(react): this should fixed serve command always build developmen…
Browse files Browse the repository at this point in the history
…t built

close #7924
  • Loading branch information
kamontat committed Mar 22, 2022
1 parent cb1fc02 commit 014cd9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/web/src/utils/devserver.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ export function getDevServerConfig(
buildOptions: WebWebpackExecutorOptions,
serveOptions: WebDevServerOptions
): Partial<WebpackDevServerConfiguration> {
const optimizationFields = Object.keys(buildOptions.optimization);
const isScriptOptimizeOn = optimizationFields.length > 0
&& optimizationFields.some(key => buildOptions.optimization[key] === true);

const webpackConfig = getWebConfig(
workspaceRoot,
projectRoot,
sourceRoot,
buildOptions,
true, // Don't need to support legacy browsers for dev.
false
isScriptOptimizeOn
);

(webpackConfig as any).devServer = getDevServerPartial(
Expand Down

0 comments on commit 014cd9c

Please sign in to comment.