最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How do I run this Bash command on Windows? - Stack Overflow

programmeradmin1浏览0评论

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
  • In this particular case, both quotes will produce the same output. Try just the echo part. – Diego Torres Milano Commented Feb 6 at 20:39
  • Be sure you are running bash. i.e. git-bash – Diego Torres Milano Commented Feb 6 at 20:41
Add a comment  | 

1 Answer 1

Reset to default 0

The 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;

发布评论

评论列表(0)

  1. 暂无评论