Skip to content

Sourcemap mismatch for unpkg/UMD build #1041

@chrisdjali-wrld3d

Description

@chrisdjali-wrld3d

When building wrld.js for CDN consumption, either by passing --format umd to the microbundle command, or calling microbundle without arguments so it uses the "unpkg" entry in package.json, the source map produced contains incorrect offsets. The source maps produced for the "main", "exports" and "module" builds work properly, though.

As far as I can tell, the issue can be worked around by adding forty four whitespace characters to the start of the emitted script, although I've not confirmed whether that works for everything or just the few things I tried. I don't see an obvious reason why there'd be this offset or why 44 is the number of extra characters that magically cancels it out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions