Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get/set have been deprecated in favor of the config command

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

like image 349
danday74 Avatar asked May 07 '18 22:05

danday74


People also ask

How do you solve error this command is not available when running the angular CLI outside a workspace?

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.

Why we need Angular JSON file?

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.

What is used Angular CLI JSON?

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.


1 Answers

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

like image 146
Mr Shantastic Avatar answered Oct 07 '22 02:10

Mr Shantastic