0

Have inherited an Angular 7 app set up to use Sass. We actually don't use sass so, long story cut short, I want to simplify the build pipeline and remove need to install Python and Windows Dev Tools.

I've followed the instructions as per this link

to configure the application to use css over sass but it doesn't change the actual dependencies. When I do npm install, it still tries to install sass-loader etc and run python. None of these sass dependencies even seem to appear in package.json so I can't even get rid of them manually.

Angular seems to have gone very black box... Any suggestions would be most welcome.

  • 1
    Pretty sure all you need to do is change the config on `angular.json` where `"@schematics/angular:component"` is located to use `scss` so the value would be `"styleext": "scss"`. Then rename all your `sass`extension to `scss` – penleychan Jan 21 '19 at 18:11
  • 1
    That's what I thought but npm install is still doing all the sass, gyp stuff etc and running python. I just want rid. – BROTES DE GERMINADOS Jan 21 '19 at 20:31

1 Answers1

1

I believe that dependency comes from the angular devkit as an optional dependency. github.com/angular/angular-cli/blob/master/packages/… . Installing with --no-optional should skip it.

As for the other parts of the build, someone else will need to recommend something, but it might not be worth the time investment since it's a framework (strictly opinion).

You'll likely have to do a mass file rename. You could do a script to check every app file and change from sass to scss. At the same time, you'll have to look for every reference inside of a file and make the same change.

As far as "css" stuff SCSS is SASS (two different syntaxes), just the new version (Sassy CSS).

As far as package dependencies, the same "SASS" dependencies are still used.

  • There is no sass in the project at all just css. I can't work out how or why there are these sass dependencies because I didn't create the app. I don't want the added overhead of Wndows Build Tools in my CI environment so I need to remove the sass dependencies from the project. There appears to be no apparent way of Doing this in Angular 7 - I can't even see entries for these packages in package.json. – BROTES DE GERMINADOS Jan 21 '19 at 20:23
  • Oh, I misread css as scss.. My bad! Anyways, I believe that dependency comes from the angular devkit as an optional dependency. https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/package.json . Installing with --no-optional should skip it. –  Jan 22 '19 at 00:23
  • Yes - uninstalling angular devkit and then reinstalling with npm install --no-optional @angular-devkit/build-angular seemd to do the trick. Thanks for your help. – BROTES DE GERMINADOS Jan 22 '19 at 11:10