Closed rally25rs closed 8 years ago
Quick update; this is due to sourceMap handling. If Babelify inserts source maps, then Proxyquireify errors on them.
Using these settings:
browserify({debug: true}).transform("babelify", {sourceMaps: false});
Babelify won't generate sourceMaps and Proxyquireify will, which succeeds ( 😄 ), but the post-transpiled (non-es6) source is shown in the browser (aww 😞 ).
Is there a way to get Proxyquireify to pass-through the Babelify source maps correctly?
It seems like Proxyquireify just wraps the default browser-pack
module, so I'm surprised it doesn't work...
I spent many hours debugging this issue, found that it is due to Proxyquireify using a version of browser-pack
from Oct 2014 (dependency on ^3.0.0, current is 6.x).
This was fixed already by: https://github.com/thlorenz/proxyquireify/commit/70852af38f58f3fdc1a41f13221fa135dfa59121
(verified the fix by pointing my project directly to the github url instead of an npm version)
However the deployed NPM version wasn't bumped, so NPM install still gets 3.1.1 that was dependent on browser-pack@3.
Can someone please bump the Proxyquire version and npm publish this commit that updates browser-pack? @thlorenz
Published 3.2.0.
Using:
The file being browserified contains only:
The existence of the code comment along with the
debug:true
option for browserify combined causes the error:If
debug
is set tofalse
then there is no error. -or- if the comment is removed from the file then there is no error.Minimal example here: https://github.com/rally25rs/test-babelify
Can be cloned, then run
npm install
andnode runner.js
or justnpm start
to reproduce the error.This will execute: