Skip to content

Commit

Permalink
rolldown optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 22, 2024
1 parent 44d6ee1 commit 88be4a8
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,25 +668,6 @@ export function runOptimizeDeps(
isDynamicEntry: chunk.isDynamicEntry,
})
}
} else {
// workaround Firefox warning by removing blank source map reference
// https://github.com/evanw/esbuild/issues/3945
const output = meta.outputs[o]
// filter by exact bytes of an empty source map
if (output.bytes === 93) {
const jsMapPath = path.resolve(o)
const jsPath = jsMapPath.slice(0, -4)
if (fs.existsSync(jsPath) && fs.existsSync(jsMapPath)) {
const map = JSON.parse(fs.readFileSync(jsMapPath, 'utf-8'))
if (map.sources.length === 0) {
const js = fs.readFileSync(jsPath, 'utf-8')
fs.writeFileSync(
jsPath,
js.slice(0, js.lastIndexOf('//# sourceMappingURL=')),
)
}
}
}
}
}

Expand Down

0 comments on commit 88be4a8

Please sign in to comment.