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
"ng build --watch" breaks when any scss file in /assets folder, contains // #20909
Comments
@pamtbaau, in this case there is no real reason why this should be supported. Having a SCSS file in assets and have the build configured to copy it without being compiled into CSS in the Therefore in this case, if you are placing SCSS files in the |
My bad. To simplify the reproducible steps, I have left out my In my project I use This worked fine for a long time, until upgrading to v12. The other closed issues I referred to, contain a similar setup, with .scss file inside /assets and using // comments. |
The above will still cause the This is because all the contents of the Therefore, you need to amend the assets pattern to ignore such files. assets": [
{ "glob": "**/*", "input": "src/assets", "ignore": ["**/*.scss"], "output": "/assets" }
] My recommendation would be to dedicate the |
I understand the I'll move the styles to Nontheless:
If above questions are too much asked, you may close the issue. I'm happy with the solution. |
Indeed this is cause an error which can be consider breaking, but it’s also highlighting a misconfiguration which leads to an undesired increase in memory usage and slower build times.
In watch mode, “assets” are managed by Webpack, during non watch mode these are managed in the browser builder.
In version 12, most of the webpack build pipeline has changed due to the update to Webpack 5. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
Yes, the previous version in which this bug was not present was: 11Description
When folder
/assets
contains a.scss
file which contains//
comments,ng build --watch
will fail.When file is moved to any other folder, no issue is thrown.
See also: #20853 and #20812
🔬 Minimal Reproduction
$ ng new
$ ng build --watch
"styles": [ "src/assets/style.scss"]
style.scss
file to/assets
// comment
to/assets/style.scss
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: