babelify 7.2.0 change the way source map path is generated
See original GitHub issueWhen I use babelify 6.4.0, I have this inside my source map file:
"sources": [
"node_modules/browser-pack/_prelude.js",
"C:/Users/Osman/Dropbox/react-flux-init/client.js",
"C:/Users/Osman/Dropbox/react-flux-init/components/About.jsx",
"C:/Users/Osman/Dropbox/react-flux-init/components/App.jsx",
"C:/Users/Osman/Dropbox/react-flux-init/components/Index.jsx",
"node_modules/deep-equal/index.js",
"node_modules/deep-equal/lib/is_arguments.js",
"node_modules/deep-equal/lib/keys.js",
"node_modules/history/lib/Actions.js",
"node_modules/history/lib/AsyncUtils.js",
"node_modules/history/lib/DOMStateStorage.js",
"node_modules/history/lib/DOMUtils.js",
"node_modules/history/lib/ExecutionEnvironment.js",
"node_modules/history/lib/createBrowserHistory.js",
"node_modules/history/lib/createDOMHistory.js",
"node_modules/history/lib/createHistory.js",
"node_modules/history/lib/createLocation.js",
"node_modules/history/lib/deprecate.js",
"node_modules/history/lib/extractPath.js",
"node_modules/history/lib/parsePath.js",
"node_modules/history/lib/runTransitionHook.js",
"node_modules/invariant/browser.js",
"node_modules/process/browser.js",
"node_modules/warning/browser.js",
"C:/Users/Osman/Dropbox/react-flux-init/routes.js"
],
And when I use babelify 7.2.0, I have this:
"sources": [
"node_modules/browser-pack/_prelude.js",
"client.js",
"components\\About.jsx",
"components\\App.jsx",
"components\\Index.jsx",
"node_modules/deep-equal/index.js",
"node_modules/deep-equal/lib/is_arguments.js",
"node_modules/deep-equal/lib/keys.js",
"node_modules/history/lib/Actions.js",
"node_modules/history/lib/AsyncUtils.js",
"node_modules/history/lib/DOMStateStorage.js",
"node_modules/history/lib/DOMUtils.js",
"node_modules/history/lib/ExecutionEnvironment.js",
"node_modules/history/lib/createBrowserHistory.js",
"node_modules/history/lib/createDOMHistory.js",
"node_modules/history/lib/createHistory.js",
"node_modules/history/lib/createLocation.js",
"node_modules/history/lib/deprecate.js",
"node_modules/history/lib/extractPath.js",
"node_modules/history/lib/parsePath.js",
"node_modules/history/lib/runTransitionHook.js",
"node_modules/invariant/browser.js",
"node_modules/process/browser.js",
"node_modules/warning/browser.js",
"routes.js"
],
Using babelify 6.4.0 the result in chrome dev tools is:
Using babelify 7.2.0 the result in chrome dev tools is:
The problem is that I have components\About.jsx like the name of the file instead of the file About.jsx inside a folder structure.
In the source map files, we can see that in babelify 6.4.0 we have C:/Users/Osman/Dropbox/react-flux-init/components/About.jsx
and in babelify 7.2.0 we have components\\About.jsx
.
I bet the problem is the use of \\
instead of /
to make folder path. Other thing to notice is that the first is full path, and the second is relative to project folder.
Why babelify change this behavior? Is it a bug? What should I do to have the first behavior in babelify 7.2.0? It wasn’t easy to find this. I searched a lot.
Ps1.: I used exorcist package to take the source map in external file.
Ps2.: I think this is a very specific question, so I prefered post here instead of stackoverflow.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
I’ve published babelify@7.3.0. There’s no
sourceMapRelative
option anymore. Instead, there’s asourceMapsAbsolute
that you can set to get the old behavior.Thanks very much! Confirm: it works.