Skip to content

Commit

Permalink
chore: reduce diff for Sourcemap::toUrl/Sourcemap::toString
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Dec 11, 2024
1 parent 89b1191 commit cfdc709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): [Plugin] {
nextMap as RawSourceMap,
chunk.map as RawSourceMap,
]) as SourceMap
// TODO: rolldown's sourcemap type does not have toUrl function
// map.toUrl = () => genSourceMapUrl(map)
map.toUrl = () => genSourceMapUrl(map)
chunk.map = map

if (buildSourcemap === 'inline') {
Expand Down
3 changes: 1 addition & 2 deletions packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ function emitSourcemapForWorkerEntry(
config.build.sourcemap === 'hidden' ||
config.build.sourcemap === true
) {
// TODO: rolldown does not support sourcemap.toString()
const data = JSON.stringify(sourcemap)
const data = sourcemap.toString()
const mapFileName = chunk.fileName + '.map'
saveEmitWorkerAsset(config, {
fileName: mapFileName,
Expand Down

0 comments on commit cfdc709

Please sign in to comment.