You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, this is absolutely awesome, seriously great work. JS has sorely needed this sort of thing since forever.
I've created a file watcher in WebStorm to automatically output generated files as their source changes by running the _node -c on the file. I was wondering how complex it would be to allow a further parameter to specify the output file name, or to output the result directly to the calling process (webstorm can take the stdout and save it separately).
Or to get the compiled version returned in stdout:
_node -c myfile.js -stdout
I suspect this would be a very easy change and am happy to dive in an do this myself but wanted to know if there are any obvious "gotchas" with what I'm proposing?
THANKS!!!
The text was updated successfully, but these errors were encountered:
I have a question: why don't you use the ._js extension? This way the -c option would be sufficient.
Otherwise, this should not be too hard to implement. A few gotchas:
There is already a -o option but it is used to specify an output directory. I would not reserve a single letter for the new option because it is a bit special (source file with non-standard extension). I would call it --output-file
Implementation should not be too difficult. You would need to add the option in command.js, and then modify compiler._js/outputFile
Redirecting the output to stdout is more challenging because the code is designed to write to a file. If you really need it, I suggest to use --output-file -, which is a standard syntax for stdout in the unix world.
If reworking the code to stream to stdout is important, this could always be a "second step" in command.js: run the compiler like normal outputting to a temp file, then stream the temp file to stdout, before deleting it. A bit hacky maybe, but should get the job done. =)
Hey,
First off, this is absolutely awesome, seriously great work. JS has sorely needed this sort of thing since forever.
I've created a file watcher in WebStorm to automatically output generated files as their source changes by running the _node -c on the file. I was wondering how complex it would be to allow a further parameter to specify the output file name, or to output the result directly to the calling process (webstorm can take the stdout and save it separately).
Something like this:
Or to get the compiled version returned in stdout:
I suspect this would be a very easy change and am happy to dive in an do this myself but wanted to know if there are any obvious "gotchas" with what I'm proposing?
THANKS!!!
The text was updated successfully, but these errors were encountered: