@@ -1913,7 +1913,8 @@ type StylePreprocessorOptions = {
1913
1913
enableSourcemap : boolean
1914
1914
}
1915
1915
1916
- type SassStylePreprocessorOptions = StylePreprocessorOptions & Sass . Options
1916
+ type SassStylePreprocessorOptions = StylePreprocessorOptions &
1917
+ Omit < Sass . LegacyOptions < 'async' > , 'data' | 'file' | 'outFile' >
1917
1918
1918
1919
type StylusStylePreprocessorOptions = StylePreprocessorOptions & {
1919
1920
define ?: Record < string , any >
@@ -2017,8 +2018,8 @@ function cleanScssBugUrl(url: string) {
2017
2018
}
2018
2019
2019
2020
function fixScssBugImportValue (
2020
- data : Sass . ImporterReturnType ,
2021
- ) : Sass . ImporterReturnType {
2021
+ data : Sass . LegacyImporterResult ,
2022
+ ) : Sass . LegacyImporterResult {
2022
2023
// the scss bug doesn't load files properly so we have to load it ourselves
2023
2024
// to prevent internal error when it loads itself
2024
2025
if (
@@ -2081,7 +2082,11 @@ const makeScssWorker = (
2081
2082
2082
2083
// NOTE: `sass` always runs it's own importer first, and only falls back to
2083
2084
// the `importer` option when it can't resolve a path
2084
- const _internalImporter : Sass . Importer = ( url , importer , done ) => {
2085
+ const _internalImporter : Sass . LegacyAsyncImporter = (
2086
+ url ,
2087
+ importer ,
2088
+ done ,
2089
+ ) => {
2085
2090
internalImporter ( url , importer , options . filename ) . then ( ( data ) =>
2086
2091
done ?.( data ) ,
2087
2092
)
@@ -2093,7 +2098,7 @@ const makeScssWorker = (
2093
2098
: importer . unshift ( options . importer )
2094
2099
}
2095
2100
2096
- const finalOptions : Sass . Options = {
2101
+ const finalOptions : Sass . LegacyOptions < 'async' > = {
2097
2102
...options ,
2098
2103
data,
2099
2104
file : options . filename ,
@@ -2110,16 +2115,16 @@ const makeScssWorker = (
2110
2115
return new Promise < {
2111
2116
css : string
2112
2117
map ?: string | undefined
2113
- stats : Sass . Result [ 'stats' ]
2118
+ stats : Sass . LegacyResult [ 'stats' ]
2114
2119
} > ( ( resolve , reject ) => {
2115
2120
sass . render ( finalOptions , ( err , res ) => {
2116
2121
if ( err ) {
2117
2122
reject ( err )
2118
2123
} else {
2119
2124
resolve ( {
2120
- css : res . css . toString ( ) ,
2121
- map : res . map ?. toString ( ) ,
2122
- stats : res . stats ,
2125
+ css : res ! . css . toString ( ) ,
2126
+ map : res ! . map ?. toString ( ) ,
2127
+ stats : res ! . stats ,
2123
2128
} )
2124
2129
}
2125
2130
} )
@@ -2213,7 +2218,7 @@ async function rebaseUrls(
2213
2218
alias : Alias [ ] ,
2214
2219
variablePrefix : string ,
2215
2220
resolver : ResolveFn ,
2216
- ) : Promise < Sass . ImporterReturnType > {
2221
+ ) : Promise < Sass . LegacyImporterResult > {
2217
2222
file = path . resolve ( file ) // ensure os-specific flashes
2218
2223
// in the same dir, no need to rebase
2219
2224
const fileDir = path . dirname ( file )
0 commit comments