andreypopp / reactify

[DEPRECATED] Browserify transform for JSX (superset of JavaScript used in React library by Facebook)
MIT License
690 stars 68 forks source link

Relative sourcemaps paths #52

Closed n3dst4 closed 9 years ago

n3dst4 commented 9 years ago

The sourcemaps support in 1.0 is great, but I noticed the mapped files all showed up as having absolute paths. This is a bit cumbersome to work with in browser dev tools, and leaks information about project setup etc.

This PR makes adds an option, relative-source-maps, to automatically trim process.cwd() from the start of the mapped paths (this is in line with what browserify itself does).

There's also a basedir option to override the root directory or paths.

n3dst4 commented 9 years ago

Happy to tweak this to make it the default too. Might be preferable.

andreypopp commented 9 years ago

Thanks!

Happy to tweak this to make it the default too. Might be preferable.

Yes, I think this is worth to be the default option. What other transforms (coffeeify, for example) do regarding this?

n3dst4 commented 9 years ago

Not sure, but I do know that browserify itself only ever generates relative paths.

The more I think about it, the more I think it shouldn't ever be an option. Relative paths all the time?

andreypopp commented 9 years ago

@n3dst4 yes, I think it should be relative paths all the time.... though to be honest I think this is browserify's job to relativize them.

n3dst4 commented 9 years ago

I know what you mean, but currently all it does is adjust the offsets :-/

Anyway, branch updated to make relative paths be always on.

n3dst4 commented 9 years ago

Closing due to react-tools being shelved.