From 14ad7c49c65666146372477578ee8bce05eb92db Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Wed, 22 Nov 2023 16:06:31 -0300 Subject: [PATCH] Added postinstall script --- .../react-vite-electron-example/package-lock.json | 1 + examples/react-vite-electron-example/package.json | 1 + .../react-vite-electron-example/vite.config.ts | 15 ++++++++------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/react-vite-electron-example/package-lock.json b/examples/react-vite-electron-example/package-lock.json index 0dce846..44ca243 100644 --- a/examples/react-vite-electron-example/package-lock.json +++ b/examples/react-vite-electron-example/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "react-vite-electron-example", "version": "0.1.0", + "hasInstallScript": true, "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/react-vite-electron-example/package.json b/examples/react-vite-electron-example/package.json index 5501b6d..8f1d655 100644 --- a/examples/react-vite-electron-example/package.json +++ b/examples/react-vite-electron-example/package.json @@ -22,6 +22,7 @@ "scripts": { "dev": "vite", "build": "tsc && vite build && electron-builder", + "postinstall": "electron-builder install-app-deps", "preview": "vite preview", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,sass,scss,less,html,md,yml,yaml}\"", "lint": "eslint .", diff --git a/examples/react-vite-electron-example/vite.config.ts b/examples/react-vite-electron-example/vite.config.ts index d1661ba..c65e039 100644 --- a/examples/react-vite-electron-example/vite.config.ts +++ b/examples/react-vite-electron-example/vite.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'vite'; import path from 'path'; import react from '@vitejs/plugin-react'; import eslint from 'vite-plugin-eslint'; -import electron from 'vite-electron-plugin' +import electron from 'vite-electron-plugin'; import { VitePWA } from 'vite-plugin-pwa'; const { PORT = '3000' } = process.env; @@ -42,12 +42,13 @@ const vitePluginPWA = () => }, }); -const electronPlugin = () => electron({ - include: [ - // The Electron source codes directory - 'electron', - ], -}); +const electronPlugin = () => + electron({ + include: [ + // The Electron source codes directory + 'electron', + ], + }); // https://vitejs.dev/config/ export default defineConfig({