Skip to content

Problem with source map root #102

@archaeron

Description

@archaeron

Hello and thanks for your great work @mishoo :)

I have a problem with the source map, but I'm not sure if I'm just doing it wrong.

My problem is, that when i use:

uglifyjs --source-map assets/scripts/min/concatenated.js.map \
        --output assets/scripts/min/min.js assets/scripts/min/concatenated.js

and the URL doesn't match the filesystem it doesn't load the sourcemap.

what I'd need for it to work would be that in the minified file (min.js) would be

//@ sourceMappingURL=/assets/scripts/min/concatenated.js.map

instead of

//@ sourceMappingURL=assets/scripts/min/concatenated.js.map

(please notice the /at the beginning of the url)

So I thought the --source-map-rootwould fix that

uglifyjs --source-map assets/scripts/min/concatenated.js.map \
        --source-map-root "/" \
        --output assets/scripts/min/min.js assets/scripts/min/concatenated.js

but it doesn't work.

I've tried the new --source-map-url but this does change the entry in the minified file, but not the one in the source map ("sources":["assets/scripts/min/concatenated.js"]instead of "sources":["/assets/scripts/min/concatenated.js"])

I hope my point is clear. If something isn't clear in my question, or I'm doing something terribly wrong I'd be happy to hear about it :)

Thanks again for your great software!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions