Skip to content

chore: allow overriding the check for the bundle size #1569

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/runtime/src/helpers/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ export const checkForRootPublish = ({
}

export const checkZipSize = async (file: string, maxSize: number = LAMBDA_MAX_SIZE): Promise<void> => {
// Experimental: We can skip checking for the bundle size on the plugin side.
// Please reach out to the Netlify support team if you'd like to enable this feature
if (!process.env.NETLIFY_CHECK_BUNDLE_SIZE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd thought this would be the other way around, where you'd set an environment variable if you want to bypass the size check. I don't see anyone going out of their way to enable this variable, so this would effectively amount to disabling the check?

console.log('Skipping the bundle size check. Set env var "NETLIFY_CHECK_BUNDLE_SIZE=true" to enable checking the bundle size')
return
}

if (!existsSync(file)) {
console.warn(`Could not check zip size because ${file} does not exist`)
return
Expand Down