Amplify doesn't work by default on ESM-based sites because it expects you to webpack it.
Building a library using this import set
and this webpack config
1.1mb of JS transferred over the network with a total size of
12.1 MB. yikes.
webpack --production brings it down to a lowly
404k. Still many times the size of everything else on my site combined.
Under the [Advanced Workflows tab (https://docs.amplify.aws/lib/auth/advanced/q/platform/js#using-modular-imports) in the
#using-modular-imports heading of the amplify auth documentation, we can see that there's a completely separate package we should be using.
With that, we get
281k which to be honest I'm happy with and feel bad about.
Unfortunately I need the API package as well
so my bundle size is 433kb. :scream: