Skip to content

Commit cf94d31

Browse files
Fix Sass fallback to pass implementation object
Ensure sass-loader receives the correct implementation in CJS/ESM environments by using mod.default || mod when falling back to 'sass'. This aligns with the 'sass-embedded' path and avoids interop pitfalls. No functional output changes are expected; this improves compatibility and reduces deprecation warnings in some environments
1 parent d9cc0eb commit cf94d31

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

build.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ async function runWebpack(isWithoutKatex, isWithoutTiktoken, minimal, sourceBuil
9595
sassImpl = mod.default || mod
9696
} catch (e) {
9797
const mod = await import('sass')
98-
// Prefer namespace import style to avoid deprecated default import warning
99-
// "import sass from 'sass'" is deprecated; use namespace instead
100-
sassImpl = mod
98+
// Ensure we pass the implementation object regardless of ESM/CJS interop
99+
sassImpl = mod.default || mod
101100
}
102101

103102
const dirKey = path.basename(sourceBuildDir || outdir)

0 commit comments

Comments
 (0)