Solomon Arnett
Solomon Arnett

Reputation: 85

Angular refuses to generate new components using scss

Angular CLI 9.1.3 Node 12.16.2 OS: darwin x64

My project was originally created to use css. Since then, I have taken the necessary steps so that the project will recognize and compile sass/scss. Unfortunately, new components are still being generated using css (quite annoying).

I've checked my angular.json file to find that all of the required changes have been made. I have gone through several guides and performed the same steps over and over to no avail. The project recognizes scss. The main styles.css is now styles.scss. The application compiles as expected. It is simply the new component generation that is not working as expected. Any help is welcome.

Upvotes: 0

Views: 148

Answers (1)

Poul Kruijt
Poul Kruijt

Reputation: 71961

Inside your angular.json you need to update/add the following path:

"projects": {
  "[PROJECT_NAME]": {
    "schematics": {
      "@schematics/angular:component": {
        "style": "scss"
      }
    }
  }
}

Also make sure you don't have any (very) old global angular cli by using:

npm i -g @angular/[email protected]

Upvotes: 2

Related Questions