node-supervisor icon indicating copy to clipboard operation
node-supervisor copied to clipboard

Is there a way to use the preload args of node?

Open vanabel opened this issue 6 years ago • 3 comments

I find some project need to start with the pre-load command;

node -r esm main.js

I try to run it as

supervisor -- main.js -r esm

However, this not work, did you know any solution?

vanabel avatar Apr 26 '19 01:04 vanabel

Hello, I had the same problem but with --harmony-proxies, you need the "-r esm" passed to node not to your program, so you need to add the support for the "-r" argument to supervisor. Like I did in my fork: https://github.com/cschinnerl-cf/node-supervisor/commit/53d418a951a39bc50a795e7f8fe6a7912ead6e44

But maybe I should have done a pull request back, so it would stay up to date.

cschinnerl-cf avatar Apr 26 '19 06:04 cschinnerl-cf

I solved it by adding an index.js and call main.js in it as the esm package home.

vanabel avatar Apr 26 '19 11:04 vanabel

I solved it by adding an index.js and call main.js in it as the esm package home.

hey do you can explain me how did you make it?

I have not could understand it

i created two files(indez and main) but my main file js is app.js and i run node app and continue the problem

and when i run node -r esm app.js works fine

sonickseven avatar Sep 03 '20 22:09 sonickseven