When trying to import a *.css
file into a .scss
using the @import
rule, I encountered some issues. The .css
file contains relative path references like url('path')
and is part of an imported library located in the node_modules
directory.
My .component.scss
file looks something like this:
@import "~libName/dist/icon";
Even though it is imported by .component.ts
, that doesn't seem to have any effect.
The
file includes the following code:node_modules/libName/dist/icon.css
src: url("icons/SAP-icons.woff") format("woff");
During building, an error is thrown stating that it cannot resolve some files.
, because the(Emitted value instead of an instance of Error) CssSyntaxError:
icons/icon.woff
referenced inicon.css
cannot be found due to an incorrect relative path.
This issue occurred while working with angular v.7.3
along with CLI.