Closed
Description
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.
Activity