Skip to content

Commit

Permalink
Revert "fix external example"
Browse files Browse the repository at this point in the history
This reverts commit 07b1501.
  • Loading branch information
evanw committed Jul 2, 2024
1 parent 328377b commit 48bd1a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/content/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3976,25 +3976,24 @@ body:
- example:
cli:
- $: |
echo 'import "foo"' > app.js
echo 'require("foo")' > app.js
- $: |
esbuild app.js --bundle --external:foo --format=esm
esbuild app.js --bundle --external:foo
- expect: |
// app.js
import "foo";
require("foo");
mjs: |
import * as esbuild from 'esbuild'
import fs from 'node:fs'
fs.writeFileSync('app.js', 'import "foo"')
fs.writeFileSync('app.js', 'require("foo")')
await esbuild.build({
entryPoints: ['app.js'],
outfile: 'out.js',
bundle: true,
external: ['foo'],
format: 'esm',
})
go: |
Expand All @@ -4005,15 +4004,14 @@ body:
import "os"
func main() {
ioutil.WriteFile("app.js", []byte("import \"foo\""), 0644)
ioutil.WriteFile("app.js", []byte("require(\"foo\")"), 0644)
result := api.Build(api.BuildOptions{
EntryPoints: []string{"app.js"},
Outfile: "out.js",
Bundle: true,
Write: true,
External: []string{"foo"},
Format: api.FormatESModule,
})
if len(result.Errors) > 0 {
Expand Down

0 comments on commit 48bd1a9

Please sign in to comment.