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

@import scss file is not working in angular applications #1298

Open
LeLunZ opened this issue Oct 28, 2024 · 1 comment
Open

@import scss file is not working in angular applications #1298

LeLunZ opened this issue Oct 28, 2024 · 1 comment

Comments

@LeLunZ
Copy link

LeLunZ commented Oct 28, 2024

Importing the 'node_modules/flag-icons/sass/flag-icons.scss' in an scss file isn't working in newer angular applications with the esbuild bundler (which is now default).

When I do this in my styles.scss:

@import 'node_modules/flag-icons/sass/flag-icons.scss';

I get an error that the flag files can't be resolved:

✘ [ERROR] Could not resolve "../flags/4x3/de.svg" [plugin angular-css-resource]

    apps/............/src/styles.scss:1463:20:
      1463 │   background-image: url(../flags/4x3/hu.svg);
           ╵                     ~~~~~~~~~~~~~~~~~~~~~~~~

Its possible to fix this by adding $flag-icons-path: 'node_modules/flag-icons/flags'; before the @import, but that wasn't needed in older webpack angular applications.


just to clarify, importing it in the config with styles: ["node_modules/flag-icons/sass/flag-icons.scss"] is working, but then its not possible to specify $flag-icons-included-countries.

@LeLunZ
Copy link
Author

LeLunZ commented Nov 8, 2024

This is an issue in angular 17. I just upgraded to v18, and now it works.

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

No branches or pull requests

2 participants
@LeLunZ and others