Skip to content

Commit

Permalink
electron: Run vite-plugin-pwa also on build and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Oct 15, 2024
1 parent 5185b1d commit 6e86b4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "vite build",
"build:serve": "bun run build && bun run serve",
"coverage": "vitest --coverage",
"deploy:electron:dir": "electron-builder --dir",
"deploy:electron": "electron-builder --publish=never -c.extraMetadata.version=$(git describe --tags --abbrev=0 | sed 's/^v//')",
"deploy:flatpak": "electron-builder --x64 --linux flatpak",
"deploy:electron:dir": "ELECTRON=true electron-builder --dir",
"deploy:electron": "ELECTRON=true electron-builder --publish=never -c.extraMetadata.version=$(git describe --tags --abbrev=0 | sed 's/^v//')",
"deploy:flatpak": "ELECTRON=true electron-builder --x64 --linux flatpak",
"dev": "vite --host",
"dev:electron": "ELECTRON=true vite --host",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --max-warnings=0",
Expand Down
5 changes: 3 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import vuetify from 'vite-plugin-vuetify'

const path = require('path') // eslint-disable-line @typescript-eslint/no-var-requires

// Check if we're running in Electron mode
// Check if we're running in Electron mode or building the application
const isElectron = process.env.ELECTRON === 'true'
const isBuilding = process.argv.includes('build')

export default defineConfig({
plugins: [
isElectron &&
(isElectron || isBuilding) &&
electron({
entry: 'electron/main.ts',
vite: {
Expand Down

0 comments on commit 6e86b4f

Please sign in to comment.