I am using the ng-cli
build tool to assemble my Angular2 application.
I am using Sass to style my components. Within these sass files I would like to import some sass content from bootstrap.
I have achieved this by using a Sass @import
using a relative path to the relevant bootstrap files underneath node_modules
:
@import "../../../../node_modules/bootstrap/scss/_variables.scss";
This is a bit cumbersome, and breaks if I change the directory structure of my components.
Is there a neater mechanism to import form node_modules
without the relative path?
It seems like the sass property includePaths
would allow me to state node_modules
as an include path, and allow me to have the succinct import
@import "bootstrap/scss/_variables.scss";
How can I instruct ng-cli
to configure Sass with includePaths
?