How do I add Sass compilation in Angular CLI 6: angular.json?

前端 未结 3 632
再見小時候
再見小時候 2021-01-30 02:02

I just created a new Angular project using the new Angular CLI 6.0, but I need to add Sass compilation to my project. I\'m aware you can set a flag when you create a project, bu

3条回答
  •  执笔经年
    2021-01-30 02:51

    Currently on version 9.0.6 this is a little different. Per Dico and Smokey Dawson above you would use the following in your angular.json:

    "projects": {
        "angular-app": {
            "root": "",
            "sourceRoot": "src",
            "projectType": "application",
            "prefix": "app",
            "schematics": {
                "@schematics/angular:component": {
                    "styleext": "scss"
                }
            },
            "architect": {...}
        }
    }
    

    But in later versions the styleext property has changed to just style. Sourced from Angular Github here.

提交回复
热议问题