Using angular-cli at the command line, I executed:
ng set defaults.styleExt styl
to set the default styling to Stylus and I got this response:
get/set have been deprecated in favor of the config command
I want to change the style extension on an EXISTING project to use SCSS. How do I do this using the config command? Where is the documentation for ng config?
I am using Angular CLI v6.0.0
ng help says:
config Get/set configuration values
but doesn't elaborate. Thanks
To Fix Error “This command is not available when running the Angular CLI outside a workspace Error”, Do Right-Click on yours project name in VS Code and Click “Open in Integrated Terminal” Option. It would open the project to your terminal and error would be fixed.
The angular.json file at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults. These are used for build and development tools provided by the Angular CLI. Path values given in the configuration are relative to the root workspace directory.
Angular CLI uses JSON Schema to enforce the configuration schema. The Angular team created Schematics packages which are used by the CLI. We can configure the options of Schematics packages, as we please, for the root project and internal projects as well.
For Angular 6 you want to use the following command:
ng config schematics.@schematics/angular:component.styleext styl
This will automatically add the "schematics" section halfer mentioned to the angular.json file.
Here is the official documentation: https://github.com/angular/angular-cli/wiki/stories-css-preprocessors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With