@@ -1917,7 +1917,8 @@ type StylePreprocessorOptions = {
19171917 enableSourcemap : boolean
19181918}
19191919
1920- type SassStylePreprocessorOptions = StylePreprocessorOptions & Sass . Options
1920+ type SassStylePreprocessorOptions = StylePreprocessorOptions &
1921+ Omit < Sass . LegacyOptions < 'async' > , 'data' | 'file' | 'outFile' >
19211922
19221923type StylusStylePreprocessorOptions = StylePreprocessorOptions & {
19231924 define ?: Record < string , any >
@@ -2024,8 +2025,8 @@ function cleanScssBugUrl(url: string) {
20242025}
20252026
20262027function fixScssBugImportValue (
2027- data : Sass . ImporterReturnType ,
2028- ) : Sass . ImporterReturnType {
2028+ data : Sass . LegacyImporterResult ,
2029+ ) : Sass . LegacyImporterResult {
20292030 // the scss bug doesn't load files properly so we have to load it ourselves
20302031 // to prevent internal error when it loads itself
20312032 if (
@@ -2090,7 +2091,11 @@ const makeScssWorker = (
20902091
20912092 // NOTE: `sass` always runs it's own importer first, and only falls back to
20922093 // the `importer` option when it can't resolve a path
2093- const _internalImporter : Sass . Importer = ( url , importer , done ) => {
2094+ const _internalImporter : Sass . LegacyAsyncImporter = (
2095+ url ,
2096+ importer ,
2097+ done ,
2098+ ) => {
20942099 internalImporter ( url , importer , options . filename ) . then ( ( data ) =>
20952100 done ?.( data ) ,
20962101 )
@@ -2102,7 +2107,7 @@ const makeScssWorker = (
21022107 : importer . unshift ( options . importer )
21032108 }
21042109
2105- const finalOptions : Sass . Options = {
2110+ const finalOptions : Sass . LegacyOptions < 'async' > = {
21062111 ...options ,
21072112 data,
21082113 file : options . filename ,
@@ -2119,16 +2124,16 @@ const makeScssWorker = (
21192124 return new Promise < {
21202125 css : string
21212126 map ?: string | undefined
2122- stats : Sass . Result [ 'stats' ]
2127+ stats : Sass . LegacyResult [ 'stats' ]
21232128 } > ( ( resolve , reject ) => {
21242129 sass . render ( finalOptions , ( err , res ) => {
21252130 if ( err ) {
21262131 reject ( err )
21272132 } else {
21282133 resolve ( {
2129- css : res . css . toString ( ) ,
2130- map : res . map ?. toString ( ) ,
2131- stats : res . stats ,
2134+ css : res ! . css . toString ( ) ,
2135+ map : res ! . map ?. toString ( ) ,
2136+ stats : res ! . stats ,
21322137 } )
21332138 }
21342139 } )
@@ -2223,7 +2228,7 @@ async function rebaseUrls(
22232228 alias : Alias [ ] ,
22242229 variablePrefix : string ,
22252230 resolver : ResolveIdFn ,
2226- ) : Promise < Sass . ImporterReturnType > {
2231+ ) : Promise < Sass . LegacyImporterResult > {
22272232 file = path . resolve ( file ) // ensure os-specific flashes
22282233 // in the same dir, no need to rebase
22292234 const fileDir = path . dirname ( file )
0 commit comments