angular - 我在哪里声明 Angular 8.x 中 SASS 文件的加载路径?

标签 angular sass configuration

根据 docs on SASS ,我应该通过在 config file .angular.cli.json 中添加 stylePreprocessorOptions 来指定加载路径如下所示。

"root": "src",
...
"stylePreprocessorOptions": {
  "includePaths": [ "./stylings" ]
}

配置文件有changed its name反复,现在是 angular.json。根据this answer , 新文件不仅有新的语法,还有 new schematics .

我真的不知道把旧配置规范放在新格式的什么地方,也不知道它是否更改了名称或格式。

我现在该怎么做?

最佳答案

示例 angular.json 文件:

"projects": {
  "app-name": {
    "projectType": "application",
    "root": "apps/app-name",
    "architect": {
      "build": {
        "builder": "@angular-devkit/build-angular:browser",
        "options": {
          "stylePreprocessorOptions": {
            "includePaths": [
              "."
            ]
          }
    ...
}     

阅读有关 workspace config 的更多信息.请记住在更改 angular.json 文件后重新启动应用程序。 (即使浏览器在保存时重新加载应用程序,HMR 也不会考虑源目录之外的更改。并且上述文件位于根目录中。)

关于angular - 我在哪里声明 Angular 8.x 中 SASS 文件的加载路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59157556/

相关文章:

css - 如何使用 Sass 和 BEM 编写修饰符

html - 网页布局在不同屏幕上显示不同

java - OSGi 和 Gemini JPA : Using the Configuration Admin

MongoDB ReplicaSet - 当只剩下 PRIMARY 时,PRIMARY 角色降为 SECONDARY

angular - 嵌套的 Angular2 异步管道如何解决?

angular - 错误 TS2339 : Property 'handleError' does not exist on type 'HeroService' with Angular

node.js - Angular 版本未显示 "ng --version"

Angular 4 组件通信 - 子级到父级与订阅者

html - 悬停时不显示标签

asp.net-mvc - 没有数据库的 ASP.NET MVC 角色(并且没有角色提供程序)