electron-vite-vue/README.md
2021-05-16 20:28:02 +08:00

1.3 KiB
Raw Blame History

electron-vue-vite

Electron + Vue3 + Vite2 integration

How and Why

  • Vite is the scaffold of the future

Command

  • npm run dev
  • npm run build

Note

  • In the development environment, we need to transform the Electron related API into commonjs

  • And you can only use ESM

  • So far, I've written an esm2cjs plugin

    import { ipcRenderer } from 'electron'
    import Store from 'electron-store'
    // Will generate
    const { ipcRenderer } = require("electron")
    const Store = require("electron-store")
    
  • It works!

  • 🚀

  • 开发模式下 Electron 相关的 API 需要转换成 commonjs

  • 并且你只能用 ESM

  • 为此我写了一个 esm2cjs 插件

electron-vue-vite-webpack



License

MIT License