van
van copied to clipboard
[vanjs-jsx] Add missing ./src/jsx-runtime.js
Hi !
I'm configuring Vite to transform JSX using vanjs-jsx.
It's a JavaScript project so I don't do configuration in the tsconfig.json file but in vite.config.js :
import { defineConfig } from 'vite'
export default defineConfig({
...
esbuild: {
jsx: 'automatic',
jsxImportSource: 'vanjs-jsx'
}
})
It's working fine using the development server. But when building, vanjs-jsx/jsx-runtime is not found.
Patching the package using Yarn by adding the missing file fix the issue.
Thanks.
@cqh963852, could you take a look at this issue?
The path to jsx-runtime.js is defined in package.json.
~~Could it be that esbuild is using an old specification for path lookup?~~
Maybe this line should be adjusted
https://github.com/vanjs-org/van/blob/fdffbbd60163dd32e85d5409e74849f526e0c1cf/addons/van_jsx/package.json#L14
"require": "./src/index.js",
"import": "./src/index.js",
"types": "./src/jsx-runtime.d.ts"
I checked the history, this should be a modification error
@damienflament @cqh963852 please check out the:
- vite-starter-vanjs-ssr-jsx (express, vite, vanjs, van-plate) featuring SSR , SSG and JSX;
- vite-starter-vanjs-ssr (express, vite, vanjs, van-plate) featuring SSR and SSG.
Powered by vite-plugin-vanjs.
@thednp Hi, I have check the plugin vite-plugin-vanjs, I think this plugin brings a better practice than vanjs-jsx.
@Tao-VanJS Please mark vanjs-jsx as deprecated.