Skip to content

Use esbuild for tests and build#9

Open
johnrees wants to merge 2 commits intocloudflare:masterfrom
johnrees:esbuild
Open

Use esbuild for tests and build#9
johnrees wants to merge 2 commits intocloudflare:masterfrom
johnrees:esbuild

Conversation

@johnrees
Copy link

@johnrees johnrees commented Oct 10, 2021

Just a proposal, no worries if you don't think it's suitable for this project :)

Esbuild runs faster, simplifies the configuration a bit and wouldn't compile the project until (#8) was fixed. The node resolve plugin didn't seem to detect this issue.

npm run test

before
npm run test 3.26s user 0.68s system 125% cpu 3.140 total

after (using esbuild)
npm run test 2.20s user 0.67s system 107% cpu 2.669 total

npm run build

before
npm run build 3.21s user 0.56s system 173% cpu 2.174 total

after
npm run build 1.48s user 0.34s system 213% cpu 0.855 total

(using minify option instead of terser)
npm run build 0.44s user 0.10s system 103% cpu 0.521 total
created dist/index.mjs in 72ms

@johnrees
Copy link
Author

johnrees commented Oct 11, 2021

perhaps experimental isn't the way to go for this particular project. I added an issue to the rollup plugin that I found with injecting env here egoist/rollup-plugin-esbuild#314

@koeninger
Copy link
Contributor

Thanks for proposing this, couple of questions

  • I'm not super familiar with esbuild, does it make more sense to have a separate wrangler template that's esbuild only, rather than rollup + esbuild?
  • I'm a little concerned about the comment that it wouldn't compile with is-even but would with is-odd... I'd expect transitive dependencies to work. Do you have any more info on what the issue there was?

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

Successfully merging this pull request may close these issues.

2 participants