In the comment for executeJs it is mentioned that if an escape character is emitted from the JS task to stdout, it will parse what immediately follows as JSON, which is great. However, many existing node modules (in my case, webpack) have a flag (like --json ) to toggle JSON output vs human readable output. These flags don't by default emit the character SBT JS Engine is looking for. Could you add a flag to SbtJsTask.executeJs to simply attempt to parse whatever the output of the script is in JSON? Could the parser also tolerate whatever whitespace / line-break settings are used to produce the JSON output?
My current workaround for this is to essentially wrap the Webpack CLI with another script which will emit the proper character and also remove all whitespace from the output of Webpack.
In the comment for executeJs it is mentioned that if an escape character is emitted from the JS task to stdout, it will parse what immediately follows as JSON, which is great. However, many existing node modules (in my case,
webpack) have a flag (like--json) to toggle JSON output vs human readable output. These flags don't by default emit the character SBT JS Engine is looking for. Could you add a flag to SbtJsTask.executeJs to simply attempt to parse whatever the output of the script is in JSON? Could the parser also tolerate whatever whitespace / line-break settings are used to produce the JSON output?My current workaround for this is to essentially wrap the Webpack CLI with another script which will emit the proper character and also remove all whitespace from the output of Webpack.