From 3e3aa7cc7eb337d1493457d2648c1a65d61be8b4 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 26 Nov 2020 23:45:34 +0000 Subject: [PATCH] Fix double build when using ng serve (#4805) --- src/frontend/packages/devkit/src/build/extensions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/packages/devkit/src/build/extensions.ts b/src/frontend/packages/devkit/src/build/extensions.ts index 5b57e81d73..33e23c7e85 100644 --- a/src/frontend/packages/devkit/src/build/extensions.ts +++ b/src/frontend/packages/devkit/src/build/extensions.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import * as path from 'path'; -import { NormalModuleReplacementPlugin } from 'webpack'; +import { NormalModuleReplacementPlugin, WatchIgnorePlugin } from 'webpack'; import { StratosConfig } from '../lib/stratos.config'; @@ -63,6 +63,10 @@ export class ExtensionsHandler { regex = importModuleRegex; } + // Ignore changed in the overrides file - otherwise with ng serve we will build twice + // The user needs to restart `ng serve` anyway if new extensions are added + webpackConfig.plugins.push(new WatchIgnorePlugin([overrideFile])); + webpackConfig.plugins.push(new NormalModuleReplacementPlugin( regex, overrideFile