-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
add support for functional build.transpile
with vite builder
#14729
Comments
Do you think it's worth adding support for it to vite builder too @pi0? I think it could be useful as someone might want to transpile in server/client context only. |
build.transpile
with vite builder
Yes, we added it to Nuxt 2 for webpack too (main usecase was a transpile for nuxt/http module only on server) makes sense to support function entries for transpile accepting env for vite too (universally) 👍🏼 |
@danielroe @pi0 I'd be happy to help out with this one. Would you mind pointing me in the right direction? What directories/files would be a good starting point? |
The documentation for transpile says:
However, when I try to provide a function in the transpile array I always get If I understand this issue correct the above functionality isn't actually merged yet?
EDIT: The typo in the documentation I quoted was fixed. |
Environment
https://codesandbox.io/s/amazing-minsky-nwzxcr?file=/nuxt.config.js
Reproduction
In the "nuxt.config.js" define the build transpile like:
import { defineNuxtConfig } from "nuxt";
export default defineNuxtConfig({
build: {
transpile: [({ isDev }) => isDev && "lodash"]
}
});
Then execute "npm run build"
Describe the bug
The nuxt build is returns the error in logs section. And lodash is not transpiled.
Additional context
The functionality work properly when the nuxt.config is done in typescript ("nuxt.config.ts").
Config from nuxt documentation.
https://nuxtjs.org/docs/configuration-glossary/configuration-build/#transpile
Logs
The text was updated successfully, but these errors were encountered: