【发布时间】:2019-03-29 00:15:07
【问题描述】:
因此,我正在尝试对我的应用进行“白标化”,从而允许为多个客户提供多种设计选项。在我的组件的 scss 中,我需要加载一个位于此“主题”文件夹下的“_variables.scss”,结构如下:
/
- themes
-- client-1
--- _variables.scss
-- client-2
--- _variables.scss
在我的 angular.json 中,我有这个配置:
"projects": {
"client-1": {
...
"architect": {
"build": {
...
"options": {
...
"stylePreprocessorOptions": {
"includePaths": [
"themes/client-1"
]
},
"styles": [
"src/styles.scss",
]
...
}
...
}
},
"client-2": {
...
"architect": {
"build": {
...
"options": {
...
"stylePreprocessorOptions": {
"includePaths": [
"themes/client-2"
]
},
"styles": [
"src/styles.scss",
]
...
}
...
}
}
}
根据documentation,我做得对,但我的 scss 文件没有正确加载文件“变量”。这是我的 scss 文件的导入:
@import "variables";
这是发生的错误:
ERROR in ./src/app/app.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@import "variables";
^
File to import not found or unreadable: variables.
in /Users/erick/Projects/sample-project/src/styles.scss (line 2, column 1)
有什么建议可以在这里处理吗?
【问题讨论】:
标签: angular sass angular-cli