Open lisbakke opened 7 years ago
Support for the Node.js
configuration would be awesome!
No promises at this time since there is no guarantees it can be done (it always depends on the way how the run configuration is implemented in the platform) but I'll take a look and will let you know!
Thanks!
Hey @Ashald - did this seem feasible? it would be a great feature for node
I recall looking at it... And on one hand I didn't find what I was looking for but on the other hand I didn't find a proof that this cannot be done. I'll try to find some time for it. OTOH, I just got in touch with JetBrains and I want to talk them into either adding required interfaces or incorporating plugin functionality into the IDE on its own.
Any update on support Webstorm
@Ashald Any updates concerning this request?
Last time I checked it was still the same. I'd suggest following an example of #37 and filing an issue for JetBrains as was done in https://github.com/Ashald/EnvFile/issues/37#issuecomment-362879301
Hi @Ashald Asking again, as our team would also be very happy to make use of EnvFile for node.js applications, how can we help or what would be missing to have access to the plugin? Would it also be possible (if not easier?) to have it in Goland when installing the node.js plugin? Thanks a lot! :)
If I recall correctly, last time I checked the node.js plugin it was not compatible with plugin APIs used for integration with other platforms so it was not possible to do that at all. But I will take another look.
I will use this ticket to track progress related to Node.js integration. Regardless of an IDE (WebStorm, IDEA, PyCharm etc) under the cover all of them rely on the same plugin to provide support for Node.js run configurations.
Last time I checked the Node.js plugin was missing support for the standard plugin interface that EnvFile plugins requires (other language plugins support it). I will check the latest version of the plugin when I can and will post an update here. If it was added it should be straightforward to implement this. Otherwise I will ask everybody interested in this follow the example of https://github.com/Ashald/EnvFile/issues/37#issuecomment-362879301 and request JetBrains to add the required plugin interface to Node.js - as seen in referenced comment they reacted to similar request within few months in the past.
Created https://youtrack.jetbrains.com/issue/WEB-36734 to support this issue.
As a workaround I currently use https://github.com/motdotla/dotenv
To do this, just run
npm i -D dotenv # short for npm install --save-dev
# or if you're using yarn
yarn add -D dotenv
Then add -r dotenv/config
to the Node parameters in the Run/Debug Configurations
window as seen in the picture. (-r
is short for --require
)
The other options are just needed for my TypeScript setup. You probably don't need this.
-r ts-node/register
is used to compile TypeScript "on the fly"
-r tsconfig-paths/register
loads TypeScript path aliases for Node.js
Edit:
Interestingly today it the debugger stopped working. It just didn't attach anymore. I had to remove the --inspect
flag from the Node arguments. (I also updated the screenshot)
I've been using the plugin in GoLand and RubyMine for quite awhile. I just started a Node project (using WebStorm) and I miss it.
BTW RafaelKr your workaround is working for me at the moment - thanks!
@mlsquires there is nothing that can be done about it until https://youtrack.jetbrains.com/issue/WEB-36734 is addressed - please upvote the linked issue to help it happen sooner.
It should be possible now finally! :) https://youtrack.jetbrains.com/issue/WEB-36734#focus=Comments-27-4463491.0-0
Any updates on this?
+1, this would be a great addition for this plugin
+1, would love to see this get updated. Just started to dip my toe in React and have been using this for Rails for years now.
What exact run configurations you would like to have supported?