-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Not applicable
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
No response
Backend
None
Environment information
I'm using Deno/esbuild/webpack for repro.
Describe the bug
The size of amplify seems excessive when you aren't using the UI. Usually this is a hint that barrel exports are happening including a lot of unneeded stuff (regardless of tree shaking)
With Webpack I am seeing 120KB versus 176KB on output sizes when doing static imports versus dynamic imports.
With esbuild it is 135KB versus 169KB on output sizes for static versus dynamic.
I'm seeing it going down to about 40KB gzipped/broccoli over the network.
Expected behavior
I would hope that amplify isn't double the size of my initial loaded bundle being just an auth library and where I am not even using the UI parts. Importing only:
import { Amplify } from "aws-amplify";
import {
confirmSignUp,
resetPassword,
signOut,
signUp,
} from "aws-amplify/auth";
console.log(Amplify);
console.log({ confirmSignUp, resetPassword, signOut, signUp });the size of my bundles will be double the size. Only importing this is 135.5kb
Reproduction steps
I've included an example repro.
- Install deno -> https://deno.com/
- deno install
- deno task webpack (to build with webpack to see the outputs in the build directory)
- deno task esbuild (to build with esbuild to see the outputs in the build directory)
Code Snippet
No response
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response