Skip to content

Commit cfdc709

Browse files
committed
chore: reduce diff for Sourcemap::toUrl/Sourcemap::toString
1 parent 89b1191 commit cfdc709

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): [Plugin] {
711711
nextMap as RawSourceMap,
712712
chunk.map as RawSourceMap,
713713
]) as SourceMap
714-
// TODO: rolldown's sourcemap type does not have toUrl function
715-
// map.toUrl = () => genSourceMapUrl(map)
714+
map.toUrl = () => genSourceMapUrl(map)
716715
chunk.map = map
717716

718717
if (buildSourcemap === 'inline') {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ function emitSourcemapForWorkerEntry(
166166
config.build.sourcemap === 'hidden' ||
167167
config.build.sourcemap === true
168168
) {
169-
// TODO: rolldown does not support sourcemap.toString()
170-
const data = JSON.stringify(sourcemap)
169+
const data = sourcemap.toString()
171170
const mapFileName = chunk.fileName + '.map'
172171
saveEmitWorkerAsset(config, {
173172
fileName: mapFileName,

0 commit comments

Comments
 (0)