Skip to content

Commit ac3fc27

Browse files
alan-agius4filipesilva
authored andcommitted
feat(@angular-devkit/build-angular): drop support for node-sass
BREAKING CHANGE: Support for `node-sass` has been removed. `sass` will be used by default to compile SASS and SCSS files.
1 parent b2411ef commit ac3fc27

2 files changed

Lines changed: 8 additions & 72 deletions

File tree

  • packages/angular_devkit/build_angular/src/webpack/configs
  • tests/legacy-cli/e2e/tests/build/styles

packages/angular_devkit/build_angular/src/webpack/configs/styles.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,14 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio
108108
);
109109
}
110110

111-
let sassImplementation: SassWorkerImplementation | undefined;
112-
try {
113-
sassImplementation = require('node-sass');
114-
wco.logger.warn(
115-
`'node-sass' usage is deprecated and will be removed in a future major version. ` +
116-
`To opt-out of the deprecated behaviour and start using 'sass' uninstall 'node-sass'.`,
117-
);
118-
} catch {
119-
sassImplementation = new SassWorkerImplementation();
120-
extraPlugins.push({
121-
apply(compiler) {
122-
compiler.hooks.shutdown.tap('sass-worker', () => {
123-
sassImplementation?.close();
124-
});
125-
},
126-
});
127-
}
111+
const sassImplementation = new SassWorkerImplementation();
112+
extraPlugins.push({
113+
apply(compiler) {
114+
compiler.hooks.shutdown.tap('sass-worker', () => {
115+
sassImplementation?.close();
116+
});
117+
},
118+
});
128119

129120
const assetNameTemplate = assetNameTemplateFactory(hashFormat);
130121

tests/legacy-cli/e2e/tests/build/styles/node-sass.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)