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(netlify): avoid second bundling #3046

Merged
merged 2 commits into from
Jan 29, 2025
Merged

fix(netlify): avoid second bundling #3046

merged 2 commits into from
Jan 29, 2025

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 29, 2025

Context: Found while investigating nuxt/nuxt#30789 (comment)

Netlify functions (both user and framework internals) are bundled by default via a last esbuild step. (netlify docs) this is an unnecessary step for Nitro as nitro already makes an optimized bundle output.

In the legacy netify v1 preset, we were using nodeModuleFormat: "esm" to preserve ESM compatibility however it is broken currently with v2 format (#2406) in 2.10.0

With this PR, ESM compat of output remains as-is

@@ -116,6 +116,8 @@ export const config = {
name: "server handler",
generator: "${getGeneratorString(nitro)}",
path: "/*",
nodeBundler: "none",
includedFiles: ["**"],
Copy link
Member Author

Choose a reason for hiding this comment

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

@serhalp this pattern is scoped to function dir right?

@@ -116,6 +116,8 @@ export const config = {
name: "server handler",
Copy link
Member Author

Choose a reason for hiding this comment

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

@serhalp (unrelated) from docs i noticed it should be displayName? 🤔 (are there some types we could reuse perhaps for this object?)

@pi0
Copy link
Member Author

pi0 commented Jan 29, 2025

Merging to try on nightly

@pi0 pi0 merged commit 12fab02 into v2 Jan 29, 2025
4 checks passed
@pi0 pi0 deleted the fix/netlify-no-bundle branch January 29, 2025 19:59
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.

1 participant