Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron: Run vite-plugin-pwa also on build and deploy #1407

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading