Pinia with Nuxt3 causing large bundle size when deployed to AWS Lambda #1764
Unanswered
mferraco
asked this question in
Help and Questions
Replies: 1 comment
-
TypeScript is probably brought in by |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I am building a Vue3/Nuxt3 project using Pinia and set up the project as defined here.
I am deploying my project to aws-lambda and I'm using vite bundler that comes packaged with Nuxt to create the project bundle that is uploaded to AWS.
Problem
When this project is deployed with
@pinia/nuxt
included as a dependency, the deployed project size in aws lambda is 33mb.When this project is deployed without
@pinia/nuxt
included as a dependency, the deployed project in aws lambda is 9.3 mb.This is an issue because AWS Lambda has a deployment package max size of 50mb zipped.
After digging into the files included in the deployed bundle, I realized that the
@pinia/nuxt
package is includingtypescript
as a dependency in the deployed package on aws lambda. The typescript package alone results in >70% of the 33mb package size when@pinia/nuxt
is included in the project. It disappears when@pinia/nuxt
is removed from the project. This package is a dev dependency and shouldn't be in the deployment package.Question
Why is
typescript
being included as a dependency when deploying my project with@pinia/nuxt
?Beta Was this translation helpful? Give feedback.
All reactions