-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Sass mixin still uses ~ (tilde) in $directory which is unsupported by newer bundlers #798
Comments
I think this idea may unintentionally affect many builds with older bundlers and potentially be breaking for some of them. I'm a little uncomfortable making such a change without knowing how many users this could impact. The current workaround would be to use the |
That would certainly help as things transition away from tildes. At some point, though, it seems like non-tilde will be the norm. So it may be worth considering reversing the defaults at some point when it makes sense. But yeah, an interim solution might help. |
Alternatively I fixed this issue by doing the following in the vite config file: resolve: {
alias: [
{
// Workaround to emulate behavior of ~ prefix in Wepback that refers to a relative path in node_modules folder
find: /~(.+)/,
replacement: `${process.cwd()}/node_modules/$1`
}
]
} |
Describe the bug
The use of ~ in the css
url
statement for the$directory
variable default is causing errors in Angular's newer esbuild-based build system. My understanding is webpack is moving away from this convention as well. Angular's non-esbuild build system supports with or without ~. So it would seem to me that removing the ~ from the$directory
default would allow for maximum capability.Steps to Reproduce
ng new test-app
yarn add @fontsource/roboto
styles.scss
:angular.json
to esbuild builderChange:
to
ng build
Expected behavior
Should build successfully. But instead I receive the following error:
Version
5.0.2
OS
Windows 11
Browser
Chrome
Additional context
Recommend removing the ~ from
fontsource/packages/cli/src/sass/mixins.ts
Lines 43 to 47 in 0f4d2c7
The text was updated successfully, but these errors were encountered: