From 76b83d4cb2a23b9c0dc0f38198d68acf7a2c09a9 Mon Sep 17 00:00:00 2001 From: Vincent Marta Date: Fri, 16 Sep 2022 12:38:54 -0700 Subject: [PATCH] Dev server: minimize the "Module not found" error during rebuilds (#722) * Minimize the "Module not found" error I found webpack to be too eager to rebuild the app you're working on, whenever one of our sdk packages is built. We needed a way to tell webpack to wait a bit before doing its rebuild. * Update CHANGELOG.md --- packages/pwa-kit-dev/CHANGELOG.md | 2 ++ packages/pwa-kit-dev/src/configs/webpack/config.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/pwa-kit-dev/CHANGELOG.md b/packages/pwa-kit-dev/CHANGELOG.md index 4dd5238a05..cd2fd1a366 100644 --- a/packages/pwa-kit-dev/CHANGELOG.md +++ b/packages/pwa-kit-dev/CHANGELOG.md @@ -1,4 +1,6 @@ ## v2.3.0-dev (Aug 25, 2022) +- Minimize "Module not found" error during webpack rebuild, whenever a package dependency is being updated/built [#722](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/722) + ## v2.2.0 (Aug 25, 2022) - Added option to specify where/from the credentials can be saved/read [#647](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/647) diff --git a/packages/pwa-kit-dev/src/configs/webpack/config.js b/packages/pwa-kit-dev/src/configs/webpack/config.js index 2c81dd0995..f99f8450fb 100644 --- a/packages/pwa-kit-dev/src/configs/webpack/config.js +++ b/packages/pwa-kit-dev/src/configs/webpack/config.js @@ -77,6 +77,9 @@ const baseConfig = (target) => { class Builder { constructor() { this.config = { + watchOptions: { + aggregateTimeout: 1000 + }, target, mode, ...(target === 'node'