Skip to content

Better source maps support when running UglifyJS outside the output directory #101

@pwnall

Description

@pwnall

UglifyJS should have better support for the scenario where it is run outside the output directory. Many libraries (including mine) set up a directory like lib/ or dist/ and build a JS file there, then minify it with UglifyJS.

I expected that --prefix would impact file and sourceMappingURL, not just sources. The new flag added in 297af47 solves half the problem, but leaves the file problem unsolved.

I'd be OK with something along the lines of --source-map-drop 1 or --source-map-except /foo/ as proposed in #100, or with a parameter that sets file. Until that happens, I need to use a cd lib/ && ... hack, which gets quite ugly when running UglifyJS from node_modules.

Thank you for reading this, and many many thanks for making the Internet better with UglifyJS!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions