New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing the getDiscordSecrets function results in 3 MB JS bundle #4
Comments
Hmm... I don't seem to be able to reproduce this? I don't believe this should be caused by include the Discord secrets, as even the I saw you removed another reference to the oculus-start-bot, appreciate that! That's my main test playground atm, so yeah, a few references were from there 馃槄 |
I'll prepare a minimum reproducible repository for you to test 馃憤 |
Here you go: I've basically made an empty skeleton with |
Not 100% sure but this might be caused by depending on discord-bot-cdk-construct/package.json Line 74 in e2aa772
Probably the construct itself doesn't need this dependency anyways?! |
You were able to reproduce it! 馃帀 CDK is at |
Gotcha, okay, you'd mentioned this was 13MB, but 3MB is different and a bit more acceptable for something like this right now (axios seems like it might be a likely candidate, as it's only blowing up the size of the commands lambda, not the discord one). I've updated the title of this to accurately reflect this and will take a look, though this isn't super high priority, as I'm sure that there's some |
Really appreciate the fixes you've made in the last hours 馃憤
However, there seems to be an issue with the tree shaking I assume.
Importing from
import { getDiscordSecrets } from "discord-bot-cdk-construct";
results in a 13 MB big lambda file.
Changing the import to
import { getDiscordSecrets } from "discord-bot-cdk-construct/dist/functions/utils/DiscordSecrets";
workarounds the problem.
I've noticed your oculus-start-bot still relies on a local version of the function, too, so this might went under your radar.
The text was updated successfully, but these errors were encountered: