devtool icon indicating copy to clipboard operation
devtool copied to clipboard

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

Open XuJinNet opened this issue 9 years ago • 13 comments

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

XuJinNet avatar Aug 02 '16 10:08 XuJinNet

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 avatar Aug 12 '16 20:08 mattdesl

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 avatar Aug 12 '16 20:08 mattdesl

@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

XuJinNet avatar Sep 02 '16 07:09 XuJinNet

same here

asfktz avatar Sep 20 '16 18:09 asfktz

same

artemave avatar Oct 23 '16 16:10 artemave

same too

shallwefootball avatar Oct 26 '16 06:10 shallwefootball

@XuJinNet same too

AlexeyAndKartashov avatar Nov 02 '16 13:11 AlexeyAndKartashov

same

micooz avatar Nov 16 '16 12:11 micooz

+1

michaelzoidl avatar Nov 22 '16 09:11 michaelzoidl

same

yangvz avatar Dec 26 '16 13:12 yangvz

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

akshay2604 avatar Mar 16 '17 17:03 akshay2604

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

akshay2604 avatar Mar 16 '17 19:03 akshay2604

@akshay2604 fixed 2.3.1 not working in 2.3.0

shallwefootball avatar Mar 16 '17 19:03 shallwefootball