ialexivy / vscode-angular2-files

vscode extension generating angular files with angular cli
MIT License
61 stars 36 forks source link

scss support for Angular 6 #29

Closed vorenus181 closed 6 years ago

vorenus181 commented 6 years ago

Scss styles extension is ignored when generating component after update to angulat v6.

ialexivy commented 6 years ago

Please make sure you define schematics in your defaultProject rather than a root, since the new angular cli 6 format allows to define schematics both on the root level and on the project level, when you update angular 5 to angular 6 the update process will put schematics on the root level level, but if you will generate a new project then the schematics will be defined on default project level, althrough it maybe best to support both ways currently only the definitions on project level are supported, follow this format:

  "defaultProject": "my-app",
  "projects": {
    "my-app":{
      "schematics": {
        "@schematics/angular:component": {
          "prefix": "cs",
          "styleext": "scss"
        },
        "@schematics/angular:directive": {
          "prefix": "cs"
        }
      }
    }
  }
}
vorenus181 commented 6 years ago

Great! It works...

ahmedkamalio commented 5 years ago

Hi @ivalexa, I'm facing this issue with Angular 8 but the solution you mentioned didn't work for me, here's my config.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "Anonymous": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      }
    }
  },
  "defaultProject": "Anonymous"
}

and ng v

Angular CLI: 8.3.0-next.1
Node: 10.15.0
OS: win32 x64
Angular: 8.2.1

any thoughts?

rustem-akhatov commented 4 years ago

@AhmedMKamal add "styleext": "scss" to "@schematics/angular:component"

i.e. your config should be

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "Anonymous": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss",
          "styleext": "scss"
        }
      }
    }
  },
  "defaultProject": "Anonymous"
}
ahmedkamalio commented 4 years ago

@rustem-akhatov I'll give it a try tomorrow and confirm if it's working or not.