File tree Expand file tree Collapse file tree 1 file changed +8
-21
lines changed
packages/angular_devkit/build_angular/src/webpack/configs Expand file tree Collapse file tree 1 file changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -107,16 +107,14 @@ export function getStylesConfig(wco: WebpackConfigOptions): Configuration {
107107 ) ;
108108 }
109109
110- const sassImplementation = getSassImplementation ( ) ;
111- if ( sassImplementation instanceof SassWorkerImplementation ) {
112- extraPlugins . push ( {
113- apply ( compiler ) {
114- compiler . hooks . shutdown . tap ( 'sass-worker' , ( ) => {
115- sassImplementation ?. close ( ) ;
116- } ) ;
117- } ,
118- } ) ;
119- }
110+ const sassImplementation = new SassWorkerImplementation ( ) ;
111+ extraPlugins . push ( {
112+ apply ( compiler ) {
113+ compiler . hooks . shutdown . tap ( 'sass-worker' , ( ) => {
114+ sassImplementation . close ( ) ;
115+ } ) ;
116+ } ,
117+ } ) ;
120118
121119 const assetNameTemplate = assetNameTemplateFactory ( hashFormat ) ;
122120
@@ -403,14 +401,3 @@ export function getStylesConfig(wco: WebpackConfigOptions): Configuration {
403401 plugins : extraPlugins ,
404402 } ;
405403}
406-
407- function getSassImplementation ( ) : SassWorkerImplementation | typeof import ( 'sass' ) {
408- const { webcontainer } = process . versions as unknown as Record < string , unknown > ;
409-
410- // When `webcontainer` is a truthy it means that we are running in a StackBlitz webcontainer.
411- // `SassWorkerImplementation` uses `receiveMessageOnPort` Node.js `worker_thread` API to ensure sync behavior which is ~2x faster.
412- // However, it is non trivial to support this in a webcontainer and while slower we choose to use `dart-sass`
413- // which in Webpack uses the slower async path.
414- // We should periodically check with StackBlitz folks (Mark Whitfeld / Dominic Elm) to determine if this workaround is still needed.
415- return webcontainer ? require ( 'sass' ) : new SassWorkerImplementation ( ) ;
416- }
You can’t perform that action at this time.
0 commit comments