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

fix: added screenshots to manifest #626

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ files:
- "!**/node_modules/**"
- "dist-electron"
- "package.json"
- "!dist-electron/screenshots/**/*"
bludnic marked this conversation as resolved.
Show resolved Hide resolved

directories:
output: './release-electron'
Expand Down
2 changes: 2 additions & 0 deletions vite-base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import commonjs from '@rollup/plugin-commonjs'
import { deferScripsPlugin } from './vite-config/plugins/deferScriptsPlugin'
import { preloadCSSPlugin } from './vite-config/plugins/preloadCSSPlugin'
import { excludeBip39Wordlists } from './vite-config/rollup/excludeBip39Wordlists'
import { excludeScreenshotsPlugin} from './vite-config/plugins/excludeScreenshotsPlugin'

export default defineConfig({
plugins: [
Expand All @@ -22,6 +23,7 @@ export default defineConfig({
}),
deferScripsPlugin(),
preloadCSSPlugin()
excludeScreenshotsPlugin()
bludnic marked this conversation as resolved.
Show resolved Hide resolved
],
css: {
postcss: {
Expand Down
19 changes: 19 additions & 0 deletions vite-config/plugins/excludeScreenshotsPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fs from 'node:fs'
import path from 'path'

/**
* Exclude screenshots from Electron bundle
*/
export function excludeScreenshotsPlugin () {
return {
name: 'exclude-screenshots-plugin',
resolveId (source) {
return source === 'virtual-module' ? source : null
},
writeBundle (outputOptions, inputOptions) {
const outDir = outputOptions.dir;
const screenshotsDir = path.resolve(outDir, 'screenshots');
fs.rm(screenshotsDir, { recursive: true }, () => console.log(`Deleted ${screenshotsDir}`))
}
}
}
bludnic marked this conversation as resolved.
Show resolved Hide resolved
Loading