我创建项目的时候使用了less,为啥我创建组件的时候(ng g c ----)出来的样式文件是css,我要怎么处理?

来源:3-8 模块的划分

o__oll

2019-06-27

http://img.mukewang.com/szimg/5d147f4e0001f19e05380540.jpg

写回答

1回答

接灰的电子产品

2019-06-27

在 angular.json 中的 schematics 指定 scss 或者其它 

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "myproj": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      }
    }
  },
  "defaultProject": "myproj"
}


0
3
o__oll
非常感谢!
2019-06-27
共3条回复

Angular 开发拼多多webapp 从基础到项目实战

高仿拼多多WebApp,带你在实战环境中学习Angular

1317 学习 · 451 问题

查看课程