I'm trying to use the esbuild CLI on Windows to minify some JavaScript.
The esbuild documentation here gives this Bash command example:
$ echo 'fn = obj => { return obj.x }' | esbuild --minify
fn=n=>n.x;
However, I do not get the expected output fn=n=>n.x;
when trying this command on Windows.
This is what I see when I try running the command on a Windows command prompt. I tried using both single quotes (') and double quotes ("):
As you can see, the expected output is not displayed. What is the correct syntax for running this Bash command on Windows?
I'm trying to use the esbuild CLI on Windows to minify some JavaScript.
The esbuild documentation here gives this Bash command example:
$ echo 'fn = obj => { return obj.x }' | esbuild --minify
fn=n=>n.x;
However, I do not get the expected output fn=n=>n.x;
when trying this command on Windows.
This is what I see when I try running the command on a Windows command prompt. I tried using both single quotes (') and double quotes ("):
As you can see, the expected output is not displayed. What is the correct syntax for running this Bash command on Windows?
Share Improve this question asked Feb 6 at 19:49 user3163495user3163495 3,5774 gold badges37 silver badges56 bronze badges 2 |1 Answer
Reset to default 0The following command worked (I removed the quotes and escaped >
with three carets, like so: ^^^>
:
C:\esbuild>echo fn = obj =^^^> { return obj.x } | esbuild --minify
fn=n=>n.x;
echo
part. – Diego Torres Milano Commented Feb 6 at 20:39bash
. i.e. git-bash – Diego Torres Milano Commented Feb 6 at 20:41