You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gave the new -p relative functionality a go, but things still don't look right. First, here's the file structure for the project:
I first compile "arrays.coffee" into "arrays-out.js" and have CoffeeScript generate a corresponding source map that gets saved to "arrays-out.map". (CoffeeScript is retarded, so I manually write that source map's file paths --- in other words, I know the paths in the source map I get from CoffeeScript are correct because I set them myself.)
Next, I tell Uglify to minify the "arrays-out.js" file and write it back to the exact same spot. I also tell Uglify to create a source map and write that map file to the exact same spot (arrays-out.map). I pass arrays-out.map as the --in-source-map parameter.
I pass -p relative to the Uglify command and I get the following source map file (I've deleted the mappings data for brevity):
There are a few problems:
The "file" path is not relative at all. When the relative flag is passed, this path should be relative to the map file's location. In this example, the path should be: "./arrays-out.js" or just "arrays-out.js" because the map file is right next to the output file.
The files in the "sources" array are indeed relative to the location of the map file, but Uglify has also included the optional sourceRoot parameter and set sourceRoot equal to: "./../" This is incorrect because the files in the sources array already have that prefix appended to them. Right now, when the browser loads this source map, it's going to take the sourceRoot value and prefix that to every item in the sources array, so it will look for sources at this path: "./.././../arrays.coffee". Obviously, this will break.
The solution is EITHER:
A) the sourceRoot parameter (which is optional according to the source map spec) needs to be omitted if the file paths in the sources array are ALREADY relative to the map file.
OR
B) if a sourceRoot path is included, the file paths in the sources array must be set relative to the SOURCE ROOT folder, not the *.map file itself.
Hopefully that all makes sense!
The text was updated successfully, but these errors were encountered:
- rename `screw_ie8` to `ie8`
- rename `mangle.except` to `mangle.reserved`
- rename `mangle.properties.ignore_quoted` to `mangle.properties.keep_quoted`
- compact `sourceMap` options
- more stringent verification on input `options`
- toplevel shorthands
- `ie8`
- `keep_fnames`
- `toplevel`
- `warnings`
- support arrays and unquoted string values on CLI
- drop `fromString` from `minify()`
- `minify()` no longer handles any `fs` operations
- unify order of operations for `mangle_properties()` on CLI & API
- `bin/uglifyjs` used to `mangle_properties()` before even `Compressor`
- `minify()` used to `mangle_properties()` after `Compressor` but before `mangle_names()`
- both will now do `Compressor`, `mangle_names()` then `mangle_properties()`
- `options.parse` / `--parse` for parser options beyond `bare_returns`
- add `mangle.properties.builtins` to disable built-in reserved list
- disable with `--mangle-props builtins` on CLI
- `warnings` now off by default
- add `--warn` and `--verbose` on CLI
- drop `--enclose`
- drop `--export-all`
- drop `--reserved-file`
- use `--mangle reserved` instead
- drop `--reserve-domprops`
- enabled by default, disable with `--mangle-props domprops`
- drop `--prefix`
- use `--source-map base` instead
- drop `--lint`
- remove `bin/extract-props.js`
- limit exposure of internal APIs
- update documentations
closes#96closes#102closes#136closes#166closes#243closes#254closes#261closes#311closes#700closes#748closes#912closes#1072closes#1366fixes#101fixes#123fixes#124fixes#263fixes#379fixes#419fixes#423fixes#461fixes#465fixes#576fixes#737fixes#772fixes#958fixes#1036fixes#1142fixes#1175fixes#1220fixes#1223fixes#1280fixes#1359fixes#1368
Gave the new -p relative functionality a go, but things still don't look right. First, here's the file structure for the project:
I first compile "arrays.coffee" into "arrays-out.js" and have CoffeeScript generate a corresponding source map that gets saved to "arrays-out.map". (CoffeeScript is retarded, so I manually write that source map's file paths --- in other words, I know the paths in the source map I get from CoffeeScript are correct because I set them myself.)
Next, I tell Uglify to minify the "arrays-out.js" file and write it back to the exact same spot. I also tell Uglify to create a source map and write that map file to the exact same spot (arrays-out.map). I pass arrays-out.map as the --in-source-map parameter.
I pass
-p relative
to the Uglify command and I get the following source map file (I've deleted the mappings data for brevity):There are a few problems:
The "file" path is not relative at all. When the relative flag is passed, this path should be relative to the map file's location. In this example, the path should be: "./arrays-out.js" or just "arrays-out.js" because the map file is right next to the output file.
The files in the "sources" array are indeed relative to the location of the map file, but Uglify has also included the optional sourceRoot parameter and set sourceRoot equal to: "./../" This is incorrect because the files in the sources array already have that prefix appended to them. Right now, when the browser loads this source map, it's going to take the sourceRoot value and prefix that to every item in the sources array, so it will look for sources at this path: "./.././../arrays.coffee". Obviously, this will break.
The solution is EITHER:
A) the sourceRoot parameter (which is optional according to the source map spec) needs to be omitted if the file paths in the sources array are ALREADY relative to the map file.
OR
B) if a sourceRoot path is included, the file paths in the sources array must be set relative to the SOURCE ROOT folder, not the *.map file itself.
Hopefully that all makes sense!
The text was updated successfully, but these errors were encountered: