-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Load wxt.config.ts
as ESM
#297
Comments
Looks like this should be possible to do with |
I get the same error when using the |
Yes, 0.19 introduced |
From #931 : I tried using jiti directly… import jiti from "jiti";
import { nodePolyfills } from "vite-plugin-node-polyfills";
console.log(
jiti(undefined, { debug: true, esmResolve: true }).resolve(
"vite-plugin-node-polyfills",
{ paths: [process.cwd()] }
)
); |
Um...they seem to be intentional, but from our user's side it's a bug as an option name. It is implemented that the This is about v1, and in v2 (now beta) Edit: Looking at |
I am using ParaglideJS i18n plugin and it uses I assume migration to ESM would fix it? |
@minht11 are you using their vite plugin? https://github.com/opral/monorepo/tree/main/inlang/source-code/paraglide/paraglide-vite I've never heard of paraglide before, so I don't have any idea what setup looks like. If you can share more details around how you're using it, that would be helpful |
I am using their vite plugin. I searched some more and found it is jiti issue opral/monorepo#2133. Anyway there is nothing todo on your end. For now I will just use Paraglide CLI. |
Jiti v2 is out with native ESM support - https://github.com/unjs/jiti/releases/tag/v2.0.0 Waiting on |
|
Describe the bug
Currently, WXT uses
c12
(andc12
usesjiti
internally) to load thewxt.config.ts
file, but it is loaded as CJS.This causes Vite 5's CJS warning to show up when importing a Vite plugin, like Vue. At the bottom of the stacktrace, you can see the warning is triggered by
@vitejs/plugin-vue
in this case. Same with all other vite plugins that import vite.To Reproduce
repro.zip
Note
Using v0.12.3 because the warning is silenced in later versions.
The warning is present in the prepare, build, and dev commands.
Expected behavior
The
wxt.config.ts
file should be imported as ESM, and these warnings should go away.Environment
Additional context
Related issues to test once fixed
The text was updated successfully, but these errors were encountered: