caoxiemeihao / vite-electron-plugin

High-performance, esbuild-based Vite Electron plugin
MIT License
54 stars 7 forks source link

incorrect config path in `electron-env.d.ts ` causes emitDeclaration to fail #37

Closed EosFoundry closed 2 years ago

EosFoundry commented 2 years ago

Error

When referencing electron-env.d.ts like so:

/// <reference types="vite-electron-plugin/electron-env" />

Running npx tsc (with or without --emitDeclarationOnly)

node_modules/vite-electron-plugin/electron-env.d.ts:10:30 
- error TS2307: Cannot find module './src/config' or its corresponding type declarations.

10     _resolved_config: import('./src/config').ResolvedConfig

Working fixes:

--  _resolved_config: import('./src/config').ResolvedConfig
++  _resolved_config: import('./types/config').ResolvedConfig

deleting line 10 also works, with no side effects yet

caoxiemeihao commented 2 years ago

Yep! Can you submit a PR to fix it? 😄