SCSS Import Relative to Root

后端 未结 5 1050
不思量自难忘°
不思量自难忘° 2020-12-09 01:12

I\'m in the process refactoring an Angular application and as I\'m moving components around to new directory locations, I\'m finding that dealing @import paths

5条回答
  •  自闭症患者
    2020-12-09 01:54

    You can use {} to reference the top level of the project path when using meteor-scss, hence something like that will work.

    @import "{}/node_modules/module-name/stylesheet";
    

    You can also use the tilda operator ~ If using webpack (or angular-cli), accessing libraries under node_modules as per the following -- Credit to @splintor

    @import "~module-name/stylesheet";
    

提交回复
热议问题