Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the list of default excluded files #508

Closed
wants to merge 1 commit into from
Closed

fix: remove the list of default excluded files #508

wants to merge 1 commit into from

Conversation

vnhlvn
Copy link

@vnhlvn vnhlvn commented Nov 29, 2023

In this PR:

  • Removes excludedFilesDefault array and its usage in pack.ts

This will actually fix #315 and allow to include any of package-lock.json, pnpm-lock.yaml, yarn.lock, package.json in the final artifact using patterns in serverless.yml.
It won't change the previous behavior as those files are not included unless specified.

@vnhlvn
Copy link
Author

vnhlvn commented Nov 29, 2023

@floydspace please take a look 🙏

@vnhlvn
Copy link
Author

vnhlvn commented Dec 6, 2023

There's an issue with the e2e:individually test failing because package.json is included in each function packaged individually, regardless of whether package.json is in the patterns or not. The problem occurs when the test tries to unzip two archives into the same folder. Since package.json is in both archives, it asks for permission to overwrite the file.

Also, if we were to keep the default list of excluded files only for individual packaging, it causes issues when package.json is added to the global patterns in serverless.yaml. In this situation, yarn struggles to parse production dependencies due to "serverless-esbuild": "file:../.." in the .esbuild folder, causing an error.

A possible solution is to remove devDependencies from package.json after copying it to the .esbuild folder and to change the unzip command to only extract the handler's file. This approach should help fix both the file conflict and the dependency parsing problems.

@vnhlvn vnhlvn closed this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra file (package.json) not included into final zips
1 participant