Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(vite-node): improve server.mjs#3967

Merged
pi0 merged 2 commits intomainfrom
fix/vite-node-manifest
Mar 30, 2022
Merged

fix(vite-node): improve server.mjs#3967
pi0 merged 2 commits intomainfrom
fix/vite-node-manifest

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented Mar 30, 2022

🔗 Linked issue

nuxt/nuxt#13466

  • Use process.env to pass server URLs instead of file replacement.
  • Improved manifest generation.
  • Fix root options for vite node runner

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 30, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 43dba28
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62443324062d3d0009f63adc
😎 Deploy Preview https://deploy-preview-3967--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu added the vite label Mar 30, 2022
process.env.NUXT_VITE_SERVER_BASE = ctx.ssrServer.config.base || '/_nuxt/'
process.env.NUXT_VITE_SERVER_ROOT = ctx.nuxt.options.rootDir

await fse.copyFile(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we are not depending on template anymore, can we avoid copy and directly use runtime/server.mjs as entrypoint?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd love to, but how could we do that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm actually we can update via nitro options but seems little hacky with legacy support of webpack.

What about generating something minimal like this inside entry:

export { default } from `path/runtime/server.mjs`

Suggestion: would be nice to also rename server.mjs to vite-node.mjs for clarity.

Copy link
Copy Markdown
Member Author

@antfu antfu Mar 30, 2022

Choose a reason for hiding this comment

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

Oh since it will write client.manifest.mjs, maybe it's better to do that after #3969? Otherwise, it writes the file to the runtime folder

Did it in 0ee2d81 (#3968)

@pi0 pi0 merged commit 43007c6 into main Mar 30, 2022
@pi0 pi0 deleted the fix/vite-node-manifest branch March 30, 2022 11:34
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants