-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Maps: Still (but less) Broken #1669
Comments
I'm not sure that is right. From the sourcemaps spec:
So |
And from the |
Actually we should ignore |
It would be correct only if you set |
Sorry; yep. I forgot to put in my explanation that I set the But even if you ignore that, the current implementation is not producing correct paths as you pointed out: ( |
Yep, but
|
Hi guys. The source map implementation in 0.48.1 is still not quite right. Here's my project folder structure. Directories are bracketed in all-caps:
I compile
basic.styl
with these options:Note that the paths in the options are full paths from my disk root, like this:
The Problem
In the scenario above, the compiler creates a source map but sets the wrong path in the "sources" array to get to the
basic.styl
file. Here's the path the compiler sets in thesources
array within the source map file:But that's not correct. If my base path is
[PROJECT]
, then the correct path for this source is:A Workaround
If you set the
--base-path
option to the same path as--out
, the compiler will set a correct, relative path from the source map to thebasic.styl
asset:While this works, the compiler should be robust enough to determine the correct paths no matter WHAT path you set as the
--base-path
option.The Ultimate goal
If no
--base-path
option is set, the Stylus compiler should look at where thefile.css.map
file is being written and then calculate correct, relative paths from THAT location to each asset listed in thesources
array within the source map file. This currently works correctly!If a
--base-path
option IS set, then the compiler should figure out the path FROM the base-path TO each asset listed in thesources
array within the source map file. (Rather than creating relative paths from the map file to each asset.) This is what's currently broken.Recommendation
Take a look at the Uglify.js 2 repo and examine the
-p relative
option, which causes Uglify.js to build relative paths for all URLs involved in source maps. It may help.The text was updated successfully, but these errors were encountered: