Closed Nyaacinth closed 2 years ago
tsconfig.json
{
+ "exclude": ["node_modules"]
}
tsconfig.json
{ + "exclude": ["node_modules"] }
It has been excluded, since “vite-electron-plugin” or “vite-plugin-electron” is imported in vite.config.ts, the source files in the package is treated as explicitly included.
tsconfig.json
{
"exclude": ["node_modules"],
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": ["vite/client"]
}
}
Consider explicitly declare them? https://github.com/electron-vite/vite-electron-plugin/blob/1cac66fa011e346c17cf9f71c65323f83790b2a2/electron-env.d.ts#L2-L12
Comparing vite-plugin-electron@0.9.3 (Passed tsc checking) and vite-electron-plugin@0.5.0 (Failed on checking), I found that types
in package.json
of vite-electron-plugin is set to src
, That might caused tsc not checking electron-env.d.ts
in the package root. So I tried to import "../electron-env"
in src/index.ts
of vite-electron-plugin, and that solved the issue.
But, I don't know how to solve this issue elegantly, hope this info can help you.
Thanks for your feedback!
Possibly generating additional .d.ts
is better :)
(And 4 more similar issues about
process.electronApp
)Seems like missing type definition