Skip to content

Commit ca92bb9

Browse files
Avoid deprecated sass default import warning
Use the namespace object for 'sass' fallback so sass-loader receives a proper implementation without triggering the 'import sass from "sass"' deprecation notice. Keeps 'sass-embedded' path unchanged
1 parent 5708e15 commit ca92bb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.mjs

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

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

0 commit comments

Comments
 (0)