Closed 332lfgb6 closed 1 week ago
No repo needed
When I use the official legacy plugin, I get this warning
import legacy from "@vitejs/plugin-legacy"; // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ devtools: { enabled: true }, vite: { plugins: [ legacy({ targets: ["Chrome 63", "ios 9"], modernPolyfills: true, }), ], }, });
{ "dependencies": { "nuxt": "^3.11.2", }, "devDependencies": { "@vitejs/plugin-legacy": "^5.4.0", } }
No response
This is because jiti (which we use to transpile the nuxt.config in c12 is loading the file in a CJS context.
jiti
nuxt.config
c12
@pi0 might have an idea about how to force ESM resolution of Vite, or a workaround here.
You can use VITE_CJS_IGNORE_WARNING=1 environment variable to hide this warning. Once vite completely drops CJS entrypoint OR when jiti v2 is landed and c12 (and nuxt) adopts it, it will be resolved.
VITE_CJS_IGNORE_WARNING=1
Environment
Reproduction
No repo needed
Describe the bug
When I use the official legacy plugin, I get this warning
Additional context
No response
Logs
No response