Skip to content

Updates to global style do not get rebuilt in watch mode on windows. #4898

@4leite

Description

@4leite

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @stencil/core@4.0.5 for the project I'm working on.

Stencil in watch mode does not rebuild when config.globalStyle is updated on windows. This is because buildCtx.filesChanged is normalised but config.globalStyle is not so the string compare fails. This probably effecting imports as well however i don't use them in my project so haven't checked.

Here is the diff that solved my problem:

diff --git a/node_modules/@stencil/core/compiler/stencil.js b/node_modules/@stencil/core/compiler/stencil.js
index aa7fe89..2e0da39 100644
--- a/node_modules/@stencil/core/compiler/stencil.js
+++ b/node_modules/@stencil/core/compiler/stencil.js
@@ -226142,7 +226142,7 @@ const canSkipGlobalStyles = async (config, compilerCtx, buildCtx) => {
   if (buildCtx.isRebuild && !buildCtx.hasStyleChanges) {
     return true;
   }
-  if (buildCtx.filesChanged.includes(config.globalStyle)) {
+  if (buildCtx.filesChanged.includes(normalizePath$2(config.globalStyle))) {
     // changed file IS the global entry style
     return false;
   }

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ionitron: missing templateThis PR or Issue does not have its template filled out

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions