Reputation: 444
I encountered some issues, by importing *.css
file with @import
into .scss
. The .css
file got some relative path url('path')
inside and belongs to imported library, so is on node_modules
.
My .component.scss
looks like that:
@import "~libName/dist/icon";
And is imported by .component.ts
, but it doesn't matter at all.
And node_modules/libName/dist/icon.css
has code:
src: url("icons/SAP-icons.woff") format("woff");
On building it throws error that can't resolve files
(Emitted value instead of an instance of Error) CssSyntaxError:
, because theicons/icon.woff
which is inicon.css
can't be found, becasue of wrong relative path.
angular v.7.3
with CLI.
Upvotes: 1
Views: 1740
Reputation: 1079
You can use {}
to reference the top level of the project path
@import "{}/node_modules/module-name/stylesheet";
Upvotes: 2