Coder Social home page Coder Social logo

Comments (5)

caoxiemeihao avatar caoxiemeihao commented on August 16, 2024

tsconfig.json

{
+ "exclude": ["node_modules"]
}

from vite-electron-plugin.

Nyaacinth avatar Nyaacinth commented on August 16, 2024

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"]
    }
}

from vite-electron-plugin.

caoxiemeihao avatar caoxiemeihao commented on August 16, 2024

Consider explicitly declare them?
https://github.com/electron-vite/vite-electron-plugin/blob/1cac66fa011e346c17cf9f71c65323f83790b2a2/electron-env.d.ts#L2-L12

from vite-electron-plugin.

Nyaacinth avatar Nyaacinth commented on August 16, 2024

Comparing [email protected] (Passed tsc checking) and [email protected] (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.

from vite-electron-plugin.

caoxiemeihao avatar caoxiemeihao commented on August 16, 2024

Thanks for your feedback!
Possibly generating additional .d.ts is better :)

from vite-electron-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.