You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use vite lib mode to create a webcomponent library. For the typings to work in JSX (React) I need an extra d.ts file. The name is not important as long as it is under src with is included by tsconfig.json.
In my case it is src/webcomponent-custom-element.d.ts:
(This file is needed otherwise there's an JSX error when I use the custom element with ` in the JSX file.)
Within vite the error is then gone. However, when I build the lib then this file gets copied over to the `dist´. But in the consumer of the lib then there is still the JSX TypeScript error.
I think this is because the package.json has only "types": "./dist/my-lib.d.ts",. So it does not know about the webcomponent typings.
Any idea on how I could get these extra file properly exported?
I saw #55 to use rollupTypes: true but this results in #126.
The text was updated successfully, but these errors were encountered:
And it does not get merged into one file, see outputDir
$ ls dist-lib/
mainWebComponent.d.ts ozgerde-vorgangsportal.js vite-env.d.ts vite.svg webcomponent-custom-element.d.ts
So there are 3 *.d.ts files. I would expect them all to be merged into mainWebComponent.d.ts which is given in the package.json as "types": "./dist-lib/mainWebComponent.d.ts",
I use vite lib mode to create a webcomponent library. For the typings to work in JSX (React) I need an extra
d.ts
file. The name is not important as long as it is undersrc
with is included bytsconfig.json
.In my case it is
src/webcomponent-custom-element.d.ts
:(This file is needed otherwise there's an JSX error when I use the custom element with ` in the JSX file.)
Within vite the error is then gone. However, when I build the lib then this file gets copied over to the `dist´. But in the consumer of the lib then there is still the JSX TypeScript error.
I think this is because the package.json has only
"types": "./dist/my-lib.d.ts",
. So it does not know about the webcomponent typings.Any idea on how I could get these extra file properly exported?
I saw #55 to use
rollupTypes: true
but this results in #126.The text was updated successfully, but these errors were encountered: