Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/probablykasper/vite-plugin-electron-x. A Vite plugin for bundling main.ts, preload.ts and running Electron in development
···11+# vite-plugin-electron-x
22+33+A Vite plugin for running Electron in development.
44+55+## Usage
66+77+Add the plugin in `vite.config.js` like this:
88+```ts
99+export default defineConfig({
1010+ plugins: [
1111+ electronDevServer({
1212+ env: {
1313+ NODE_ENV: 'development',
1414+ },
1515+ }),
1616+ ]
1717+})
1818+```
1919+2020+Load the Vite dev server in Electron:
2121+```js
2222+if (process.env.NODE_ENV === "development') {
2323+ // vite-plugin-electorn-x automatically provides the DEV_PORT environment variable to Electron
2424+ mainWindow.loadURL(`http://localhost:${process.env.DEV_PORT}`)
2525+}
2626+```
2727+2828+## Dev instructions
2929+3030+### Get started
3131+3232+1. Install Node.js
3333+2. Run `npm install`
3434+3535+### Commands
3636+- `npm run dev`: Build and watch
3737+- `npm run build`: Build