Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component styles not rebuild when changing imported scss files after first build #2660

Open
gasfab999 opened this issue Jul 27, 2023 · 1 comment
Labels

Comments

@gasfab999
Copy link

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

When trying to use scss @import features in a component scss file the component doesn't get recompiled/rebuild when editing the imported file while the build is running with --watch. Only when saving/changing again the component scss file the changes are taken up. Also on first build the import works as intended. The same happens when using the @use rule.

In my case I had one scss file where I wanted to have some shared styles and variables which I wanted to use in multiple components. Now each time I change something in the shared styles scss file I would need to go to each component and update there the component styles file. Exposing them globally is not really an option for me as I wanted to still have those css rules scoped on the component.

How To Reproduce

In this Stackblitz the behavior can be reproduced. Just let first the initial build finish, then go to the shared file called _shared-styles.scss and change for example a color. In the terminal one can see that no rebuild gets triggered by that already. In the output file dist/my-library/esm2022/lib/my-library.component.mjs the changes are also missing. Then try to make a change in the scss file which is directly included by the component via styleUrls and save it, only now the components gets rebuild with the changes of the shared scss file. This can also be seen in the above mentioned output file.

Expected Behaviour

The components styles should update as well if imported files gets changed and not only on first build or when changing the scss file referenced by the component.

Version Information

ng-packagr: 16.1.0
@angular/*: 16.1.7
typescript: 5.1.6
rxjs: 7.8.1
node: 16.20.0 (locally I had v18 with the same behavior)
npm: 9.4.2
@alan-agius4 alan-agius4 added the bug label Aug 9, 2023
@cheng93
Copy link

cheng93 commented Feb 23, 2024

I see something similar when using tailwind. Changes applied to the component ts and html does not trigger anything. But after saving the scss file, it all builds fine.

ng-packagr: 17.0.3
tailwindcss: 3.4.1
@angular/*: 17+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants