库中的角度cli生成组件不会创建scss文件

问题描述

我今天首先通过运行create project命令创建了一个新库:

ng new situ-angular-components --createApplication=false --skipTests=true --prefix=situ --style=scss

然后我创建了库:

ng g library situ-angular-components

我希望当我运行ng g c footer时,它将创建没有测试文件和SCSS文件的组件,但是不会:

enter image description here

有人知道为什么吗?

解决方法

打开您angular.json并检查schematics/angular:component

应该是这样

   "schematics": {
        "@schematics/angular:component": {
          "style": "scss","prefix": "app"
        }
      },