Skip to content

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

Closed

Description

@4leite

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @stencil/[email protected] 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.

Activity

  1. rwaskiewicz commented on Oct 5, 2023

    @rwaskiewicz
    Member

    👋 Hey there!

    Thanks for the issue report. It looks like this bug report may have been generated using patch-package - could you please use our issue template to create a new issue? We kindly ask that folks fill that out to better root cause bugs and having something concrete to test against when we do have a fix. Thanks!

  2. added
    ionitron: missing template
    on Oct 5, 2023
  3. ionitron-bot commented on Oct 5, 2023

    @ionitron-bot

    Thanks for the issue! It appears that you have not filled out the provided issue template. We use this issue template in order to gather more information and further assist you. Please create a new issue and ensure the template is fully filled out.

    Thank you for using Stencil!

  4. locked and limited conversation to collaborators on Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ionitron: missing template

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions