From 1a15f224ba420567a0bf5a6683a1d26e337721a9 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 20 Oct 2022 17:10:16 +0200 Subject: [PATCH] ensure `changedContent` gets cleared Otherwise this list gets bigger and bigger, not only that there is a subtle bug. The moment you save a `.css` file we want to create a new context and start from scratch. However, since the list was never cleared, it meant that every subsequent save to *any* file (not only config / css files) creates a new context... By clearing the least we should work around this problem. --- src/cli/build/watching.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/build/watching.js b/src/cli/build/watching.js index 8ebceccf5cc7..9b5462a244fd 100644 --- a/src/cli/build/watching.js +++ b/src/cli/build/watching.js @@ -62,7 +62,7 @@ export function createWatcher(args, { state, rebuild }) { extension: path.extname(file).slice(1), }) - chain = chain.then(() => rebuild(changedContent)) + chain = chain.then(() => rebuild(changedContent.splice(0))) return chain }