electron-toolkit
electron-toolkit copied to clipboard
fix(tsconfig): update module and moduleResolution to Node16
Description
I applied this change in my project, and it fixed the electron-store type issue, so I’m making a PR here.
quote from https://github.com/cawa-93/vite-electron-builder/issues/997#issue-2291461319 :
Hello 👋,
Thanks for this awesome template and the latest move to ESM. Great work so far!
When migrating my project to these latest changes I observed issues with the
electron-storemodule. According to its maintainer, the.tsconfigof this template is not fully "ESM-compliant". They suggest to change themoduleResolutionof the.tsconfigtonode16ornodenext. I have created a repository using this template to reproduce the problem: raphaelmenges/electron-store-type-error
Additional context
Have run pnpm typechecker found some type error like below, but it not bought by this commit, so leave it unfix.
pnpm typechecker errors
packages/playground/src/main.mts:4:40 - error TS2307: Cannot find module '@electron-toolkit/utils' or its corresponding type declarations.4 import { optimizer, electronApp } from '@electron-toolkit/utils' ~~~~~~~~~~~~~~~~~~~~~~~~~ packages/playground/src/preload.mts:2:29 - error TS2307: Cannot find module '@electron-toolkit/preload' or its corresponding type declarations. 2 import { electronAPI } from '@electron-toolkit/preload' ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Found 2 errors in 2 files. Errors Files 1 packages/playground/src/main.mts:4 1 packages/playground/src/preload.mts:2 ELIFECYCLE Command failed with exit code 2.
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines.
- [x] Read the Pull Request Guidelines and follow the Commit Convention.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123).