Closed ysabri closed 1 year ago
Hi @ysabri thank you for opening this issue. Amplify as a default export is currently deprecated and it's recommended to import as named export.
Hi @nadetastic, thanks for getting back to me on this so quickly. I haven't done any source map analysis yet but I'm assuming importing like this will get split out appropriately after tree shaking so I'm not importing the entirety of the library.
@ysabri that is correct, tree shaking will be done and remove any packages you aren't using. If you don't have any additional questions, I'll close this issue out shortly 🙂
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
So I'm upgrading from an old version (4.3.11) of aws-amplify to 5.0.8.
After doing the upgrade my build started running out of memory. I increased the max-old-space-size to 8192, that worked but the build at first would take almost all the space then go down to normal size (below 3GB).
Expected behavior
The build shouldn't need that much memory.
Reproduction steps
I looked at how I was importing amplify, this was my old code that caused the issue:
Code Snippet
Log output
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
Changing my amplify import to the one the documentation has:
Solves the issue.
I just wanted to point this out as I don't know why an import of a class that is exported by the library would cause such behavior.