Open XuJinNet opened 8 years ago
It would be cool if -r
included script(s) to be required, this might allow your use case to be supported. For reference, see:
https://github.com/Jam3/devtool/issues/1
I just pushed the -r
flag which should allow you to require some module/script before running devtool. Examples:
devtool app.js -r babel-register
devtool app.js -r ./my-prelude.js -r ./another-prelude.js
Let me know if it works for you! :smile:
@mattdesl Sorry, it not work fine, the error info:
require-hook.js:50 Uncaught Error:
/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/babel-register/lib/node.js
/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/babel-core/index.js
/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/babel-core/lib/api/node.js
/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/babel-core/lib/transformation/file/index.js
/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/convert-source-map/index.js
An error occurred while trying to read the map file at /Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/convert-source-map/foo.js.map
Error: ENOENT: no such file or directory, open '/Users/xujin/My_Projects/NodeJS/eefung-website-nodejs/node_modules/convert-source-map/foo.js.map'
Node: 6.3.1 Babel: 6 devtool: 2.2.0
same here
same
same too
@XuJinNet same too
same
+1
same
please tell if someone fixed this. I need this feature urgently.
Using devtool app.js -r babel-register
works for me
@akshay2604 fixed 2.3.1
not working in 2.3.0
My project using babel 6, how to pass "-r babel-register" to node when startup?