vite-plugin-electron

v0.28.8
Electron 🔗 Vite
vite plugin electron renderer

vite-plugin-electron

English | 简体中文

  • 感谢 @ggdream 老师提供 vite-plugin-electron 的 npm 包名 ❤️
  • 如果这个项目有帮到了你,作者很希望你能请客来一份下午茶 ٩(๑>◡<๑)۶

需要留神

  • 🚨 默认情况下, electron 文件夹下的文件将会被构建到 dist-electron
  • 🚨 目前, Electron 尚未支持 "type": "module"
  • 🚨 通常的,Vite 可能不能正确的构建 Node.js 的包,尤其是 C/C++ 原生模块,但是 Vite 可以将它们以外部包的形式加载。所以,请将 Node.js 包放到 dependencies 中。除非你知道如何用 Vite 正确的构建它们。
    electron({
      entry: 'electron/main.ts',
      vite: {
        build: {
          rollupOptions: {
            // Here are some C/C++ modules them can't be built properly.
            external: [
              'serialport',
              'sqlite3',
            ],
          },
        },
      },
    }),
    

🍵 🍰 🍣 🍟

npm i vite-plugin-electron

Metadata

  • MIT
  • Whatever
  • 草鞋没号
  • released 9/19/2024

Downloads

Maintainers