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

Support for esbuild with Deno CLI #1913

Closed
Xeevis opened this issue Jan 6, 2022 · 0 comments
Closed

Support for esbuild with Deno CLI #1913

Xeevis opened this issue Jan 6, 2022 · 0 comments

Comments

@Xeevis
Copy link

Xeevis commented Jan 6, 2022

Hello,
I love esbuild and I love Deno. But while esbuild works flawlessly when called inside a Deno script, I'd love to have it working with stdin & CLI. This would allow esbuild to be used on any output with a simple one-liner.

Basically I'm trying to "Denoify" this Node call (--version for demonstration)

npx esbuild --version

But this call will not produce any output

deno run --allow-read "https://deno.land/x/esbuild/mod.js" --version

Now if I want to use esbuild with Deno CLI, I have to go through this hoop.
deno run --allow-read build.ts

import * as esbuild from "https://deno.land/x/esbuild/mod.js";
await Deno.stdout.write(new TextEncoder().encode(esbuild.version));

But as demonstrated by examples, it should theoretically be possible to make esbuild module work in CLI?

$> deno run https://deno.land/std@0.120.0/examples/flags.ts --minify --outfile test.css
{ _: [], minify: true, outfile: "test.css" }

Of course real-world usage would be to pipe CSS/JS/TS to esbuild for transforming or minification. Any thoughts? Thanks in advance.

@evanw evanw closed this as completed in aeae3cf Jan 6, 2022
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

1 participant