Skip to content

Commit 833dabf

Browse files
sapphi-redpatak-cat
authored andcommitted
chore: merge
1 parent b39a7ed commit 833dabf

4 files changed

Lines changed: 22 additions & 27 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@types/micromatch": "^4.0.6",
5656
"@types/node": "^20.11.30",
5757
"@types/picomatch": "^2.3.3",
58-
"@types/sass": "~1.43.1",
5958
"@types/semver": "^7.5.8",
6059
"@types/stylus": "^0.48.42",
6160
"@types/ws": "^8.5.10",

packages/vite/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"rollup-plugin-dts": "^6.1.0",
145145
"rollup-plugin-esbuild": "^6.1.1",
146146
"rollup-plugin-license": "^3.3.1",
147+
"sass": "^1.72.0",
147148
"sirv": "^2.0.4",
148149
"source-map-support": "^0.5.21",
149150
"strip-ansi": "^7.1.0",

packages/vite/src/node/plugins/css.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

19221923
type StylusStylePreprocessorOptions = StylePreprocessorOptions & {
19231924
define?: Record<string, any>
@@ -2024,8 +2025,8 @@ function cleanScssBugUrl(url: string) {
20242025
}
20252026

20262027
function 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)

pnpm-lock.yaml

Lines changed: 6 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)