stencil icon indicating copy to clipboard operation
stencil copied to clipboard

When using postcss plugin, global style does not rebuild if an imported CSS file changed

Open marchbox opened this issue 6 years ago • 4 comments

Stencil version:

 @stencil/[email protected]

I'm submitting a:

[x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

  • I have a global stylesheet, e.g. src/common/css/global.css
  • In global.css, I have @import '_variables.css';
  • And I use @stencil/postcss to preprocess CSS
  • Run stencil build --dev --watch --serve
  • Updating _variables.css will not trigger global style rebuild, you'll have to restart the server to see the changes

The reason is that, postcss will concatenate global.css with _variables.css, after which there is no @import rules left in cached version global.css. So even the compiler has a check to see if there's any imported CSS files changed, it won't trigger global style rebuild. Although I'm not entirely sure why this doesn't work after I turn off cache by adding enableCache: false in stencil.config.ts.

Expected behavior:

  • Global style should rebuild

Steps to reproduce:

See “current behavior”.

marchbox avatar Aug 08 '19 00:08 marchbox

Hey there, thank you for the patience getting back to you. The new team is getting started and we're working through the backlog now.

Thank you for adding this. We don't have a timeframe, but we have identified the issue.

splitinfinities avatar Aug 10 '21 20:08 splitinfinities

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

ionitron-bot[bot] avatar Feb 06 '22 21:02 ionitron-bot[bot]

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

ionitron-bot[bot] avatar Jan 25 '24 14:01 ionitron-bot[bot]

Hey folks,

I took a crack at reproducing this locally with the latest versions of @stencil/core and @stencil-community/postcss. I was unable to do so with the reproduction case here - https://github.com/rwaskiewicz/stencil-postcss-test-1795. If this is an issue folks are still running in to, can you please add a reproduction case for me? I know it's been a while since there's been activity on this issue, and for that I apologize. If folks don't have bandwidth/want to, I completely understand.

rwaskiewicz avatar Jan 25 '24 14:01 rwaskiewicz

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

ionitron-bot[bot] avatar Feb 24 '24 14:02 ionitron-bot[bot]