Meteor aws-sdk optimisation

Hello :slight_smile:

I saw that aws-sdk is taking huge part of my application.

Do you have any ideas how I can optimise it?
I’m using aws-sdk for upload images to s3 (server side).

Ok, I came to it myself :slight_smile:
I used a dynamic import

const AWS = await import('aws-sdk');

Now my whole app is less by half :slight_smile:

if you only use it on the server, make sure its not imported on the client.

If you replace it with a dynamic import, but this import still gets called on the client somehow, you will still load it at some point :wink: if that’s on startup, it will still use the users bandwidth.

Maybe add a debugger or console statement right before the import and check whether that appears on the client or not. if not, you are fine :slight_smile:

Hi @macrozone, thank you for your message.
I’ve checked it twice and everything is running only on server side.