Experience-Monks / devtool

[OBSOLETE] runs Node.js programs through Chromium DevTools
MIT License
3.76k stars 148 forks source link

How to pass "-r babel-register" to node when startup? #86

Open XuJinNet opened 8 years ago

XuJinNet commented 8 years ago

My project using babel 6, how to pass "-r babel-register" to node when startup?

mattdesl commented 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

mattdesl commented 8 years ago

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:

XuJinNet commented 8 years ago

@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

asfktz commented 8 years ago

same here

artemave commented 7 years ago

same

shallwefootball commented 7 years ago

same too

antixrist commented 7 years ago

@XuJinNet same too

micooz commented 7 years ago

same

michaelzoidl commented 7 years ago

+1

yangvz commented 7 years ago

same

akshay2604 commented 7 years ago

please tell if someone fixed this. I need this feature urgently.

akshay2604 commented 7 years ago

Using devtool app.js -r babel-register works for me

shallwefootball commented 7 years ago

@akshay2604 fixed 2.3.1 not working in 2.3.0