scss中@import路径问题

我们在scss中引用其他的scss文件

相对路径:

@import "../../helpers/_mixins.scss";
@import "../../helpers/_utils.scss";
@import "../../themes/index.scss";

如何使用路径别名:

1、在webpack中添加路径的别名

2、可以在@import中使用~@scss来使用此别名

@charset "UTF-8";
@import "~@scss/themes/index.scss";
@import "~@scss/helpers/_mixins.scss";
@import "~@scss/helpers/_utils.scss";

 

posted @ 2018-04-10 14:49  imisou  阅读(2988)  评论(0)    收藏  举报