Skip to content

Make --output-source-map-url -osu update an existing source map section (if it exists) and otherwise add one #8190

@mkustermann

Description

@mkustermann

It seems when running wasm-opt with -ism app.unopt.wasm.map -osm app.opt.wasm.map -osu myUrl.wasm and the existing wasm file has already a source map url section, then wasm-opt will add another one - resulting in 2 source map sections.

This creates ambiguity for any consumer of the wasm file - which source map url to use or may even result in errors / not using any if there's multiple.

Could wasm-opt replace the existing section (if exists) instead of adding a new one?

(It seems like a common issue one would run into: Any compiler that emits a unoptimized wasm file may embed a relative source map url into that unoptimized wasm module. When optimizing using wasm-opt it most likely uses different filenames for the optimized wasm file and corresponding source map, therefore needing to update the source map url section)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions