Skip to content

Commit

Permalink
esbuild 0.12.23 (new formula)
Browse files Browse the repository at this point in the history
update test build

esbuild: update test

Closes #83664.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Michael Cho <cho-m@tuta.io>
Signed-off-by: Michael Cho <20700669+cho-m@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
  • Loading branch information
2 people authored and BrewTestBot committed Aug 27, 2021
1 parent 9e6b5cb commit 017fe3a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Formula/esbuild.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require "language/node"

class Esbuild < Formula
desc "Extremely fast JavaScript bundler and minifier"
homepage "https://esbuild.github.io/"
url "https://registry.npmjs.org/esbuild/-/esbuild-0.12.23.tgz"
sha256 "edeab41e47be717c176bbe79e72d6c1717b9c06f5b2e8f6433e6c18cf24d1a56"
license "MIT"

depends_on "node"

def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end

test do
(testpath/"app.jsx").write <<~EOS
import * as React from 'react'
import * as Server from 'react-dom/server'
let Greet = () => <h1>Hello, world!</h1>
console.log(Server.renderToString(<Greet />))
EOS

system Formula["node"].libexec/"bin/npm", "install", "react", "react-dom"
system bin/"esbuild", "app.jsx", "--bundle", "--outfile=out.js"

assert_equal "<h1 data-reactroot=\"\">Hello, world!</h1>\n", shell_output("node out.js")
end
end

0 comments on commit 017fe3a

Please sign in to comment.