vite-react-jsx
vite-react-jsx copied to clipboard
Files under `dist/esm/` should use the `.mjs` extension
Being present in the exports field of package.json does not automatically make the file an ES module. It must be ended with .mjs, or the package.json has to include type: "module".
https://nodejs.org/api/packages.html#packages_determining_module_system
This issue makes the plugin unusable inside vite.config.mjs.
Can't use it in vite.config.ts either. Getting
(node:78771) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
import resolve from 'resolve';
^^^^^^
SyntaxError: Cannot use import statement outside a module