framework icon indicating copy to clipboard operation
framework copied to clipboard

feat(vite): support `build.transpile` as function

Open jmorel88 opened this issue 2 years ago • 2 comments

🔗 Linked issue

#7016

❓ 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)
  • [x] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #7016 - When building Nuxt with Vite, build.transpile will now except functions. This will allow users to transpile modules through Vite's pipeline.

Additional notes

  • I've added isClient, isServer, and isDev to the ctx. Although for now this is only used with Vite's SSR property.
  • I left out isLegacy and isModern because it seems irrelevant when using Vite. Is this correct?

📝 Checklist

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

jmorel88 avatar Sep 22 '22 16:09 jmorel88

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

codesandbox[bot] avatar Sep 22 '22 16:09 codesandbox[bot]

Deploy Preview for nuxt3-docs canceled.

Name Link
Latest commit c24700556bdd637778116e8511823e3a68840509
Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63494eb46272260009ef5416

netlify[bot] avatar Sep 22 '22 16:09 netlify[bot]

@pi0 @jmorel88 can we have this merged please? It's really needed in some cases.

Some libraries / modules works on dev server without transpilation & doesn't work on production build and vice versa. For example https://github.com/aspida/aspida (their @aspida/axios package).

FarhanShares avatar Jan 06 '23 11:01 FarhanShares