Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SbtJsTask.executeJs should add flag to interpret stdout from process as JSON unconditionally #42

Open
jclyons opened this issue Dec 2, 2015 · 1 comment

Comments

@jclyons
Copy link

jclyons commented Dec 2, 2015

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.

@benmccann
Copy link
Contributor

That sounds reasonable. You mentioned webpack. I just Googled and saw two sbt-webpack plugins. Do you happen to be using either of them or how are you calling webpack?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants