Skip to content

🚀 🚀 esbuild for production builds 🚀 🚀 #35201

Closed
samouri wants to merge 2 commits intoampproject:mainfrom
samouri:esbuild-dist
Closed

🚀 🚀 esbuild for production builds 🚀 🚀 #35201
samouri wants to merge 2 commits intoampproject:mainfrom
samouri:esbuild-dist

Conversation

@samouri
Copy link
Copy Markdown
Member

@samouri samouri commented Jul 13, 2021

summary

Migrates from closure to esbuild/babel/terser for the production builds (amp dist).
The code in this PR is a POC, and there is likely much more cleanup/deletion that we could pursue if we decide to land this.

Changes:

  • All builds merge into a single flow. This includes vendor builds, npm binaries, minified, unminified, and esm/es5.
  • Enabled terser's mangle property mode, specifically for vars that end with an underscore. This is fairly dangerous, and only works because of two disabled optimizations (compress.properties, mangle.properties.keep_quoted).
    • I also removed comments from terser, not sure why we have them on today.
  • I moved build-constant replacement to esbuild, and we can definitely move the rest as well. I don't feel strongly about this and would be happy keeping them all in babel.

@samouri samouri force-pushed the esbuild-dist branch 3 times, most recently from 2ea53aa to 6057246 Compare July 13, 2021 21:51
@samouri samouri self-assigned this Jul 14, 2021
@samouri samouri force-pushed the esbuild-dist branch 3 times, most recently from 525f92a to 05fb023 Compare July 15, 2021 03:36
@kristoferbaxter kristoferbaxter changed the title wip wip esbuild for distribution Jul 15, 2021
@samouri samouri force-pushed the esbuild-dist branch 3 times, most recently from dbd8b76 to a0a165a Compare July 15, 2021 19:15
@samouri samouri changed the title wip esbuild for distribution 🚀 🚀 esbuild for production builds 🚀 🚀 Jul 15, 2021
@samouri samouri force-pushed the esbuild-dist branch 2 times, most recently from 659b649 to 1bf28cc Compare July 27, 2021 18:55
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.

1 participant