perf: use magic-string hires boundary for sourcemaps

This commit is contained in:
alex8088 2023-12-12 22:55:55 +08:00
parent 61eb32aa04
commit 4924e36d74
4 changed files with 4 additions and 4 deletions

View file

@ -173,7 +173,7 @@ export default function assetPlugin(): Plugin {
if (s) { if (s) {
return { return {
code: s.toString(), code: s.toString(),
map: sourcemap ? s.generateMap({ hires: true }) : null map: sourcemap ? s.generateMap({ hires: 'boundary' }) : null
} }
} else { } else {
return null return null

View file

@ -222,7 +222,7 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null {
if (s) { if (s) {
return { return {
code: s.toString(), code: s.toString(),
map: config.build.sourcemap ? s.generateMap({ hires: true }) : null map: config.build.sourcemap ? s.generateMap({ hires: 'boundary' }) : null
} }
} }
}, },

View file

@ -56,7 +56,7 @@ export default function esmShimPlugin(): Plugin {
s.appendRight(indexToAppend, CJSShim) s.appendRight(indexToAppend, CJSShim)
return { return {
code: s.toString(), code: s.toString(),
map: sourcemap ? s.generateMap({ hires: true }) : null map: sourcemap ? s.generateMap({ hires: 'boundary' }) : null
} }
} }

View file

@ -55,7 +55,7 @@ export default function workerPlugin(): Plugin {
return { return {
code: s.toString(), code: s.toString(),
map: sourcemap ? s.generateMap({ hires: true }) : null map: sourcemap ? s.generateMap({ hires: 'boundary' }) : null
} }
} }