-
Originally, my intention was to create a Windows installer. StepInitially, I execute Question :
package.json
{
"name": "one",
"private": true,
"version": "0.0.1",
"scripts": {
"format": "prettier --write .",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"web:preview": "vite preview",
"electron:preview": "electron-vite preview",
"dev": "electron-vite dev -w",
"web:dev": "vite",
"build": "npm run typecheck && electron-vite build",
"postinstall": "electron-builder install-app-deps",
"build:win": "npm run build && electron-builder --win"
},
"dependencies": {
"@electron-toolkit/preload": "^3.0.0",
"@electron-toolkit/utils": "^3.0.0"
},
"devDependencies": {
"@electron-toolkit/eslint-config": "^1.0.2",
"@electron-toolkit/eslint-config-ts": "^1.0.1",
"@electron-toolkit/tsconfig": "^1.0.1",
"@mdi/font": "^7.4.47",
"@rushstack/eslint-patch": "^1.7.1",
"@types/node": "^18.19.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/compiler-sfc": "^3.4.15",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vueuse/core": "^10.9.0",
"axios": "^1.6.7",
"dayjs": "^1.11.10",
"dexie": "^3.2.5",
"electron": "^28.2.5",
"electron-builder": "^24.9.1",
"electron-vite": "^2.1.0",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.22.0",
"mitt": "^3.0.1",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"prettier": "^3.2.5",
"sass": "^1.71.1",
"sass-loader": "^14.1.1",
"tree-kill": "^1.2.2",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vite-plugin-electron": "^0.15.6",
"vue": "^3.4.15",
"vue-i18n": "^9.9.1",
"vue-router": "^4.3.0",
"vue-tsc": "^1.8.27",
"vuetify": "^3.5.6"
},
"main": "./out/main/index.js"
}
electron-builder.yml
appId: com.Electron.ONE.app
productName: "Electron ONE"
directories:
buildResources: build
icon: ./resources/icon.png
# files:
# - "!**/.vscode/*"
# - "!src/*"
# - "!electron.vite.config.{js,ts,mjs,cjs}"
# - "!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}"
# - "!{.env,.env.*,.npmrc,pnpm-lock.yaml}"
# - "!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}"
asarUnpack:
- resources/**
win:
executableName: "Electron ONE"
target:
- target: nsis
arch:
- x64
- target: msi
arch:
- x64
msi:
menuCategory: true
nsis:
artifactName: ${productName}-${version}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
oneClick: false
allowToChangeInstallationDirectory: true
menuCategory: true
npmRebuild: false
electronDownload:
mirror: https://npmmirror.com/mirrors/electron/
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Usually, it’s about 70m under Windows. You may mistakenly package the |
Beta Was this translation helpful? Give feedback.
Usually, it’s about 70m under Windows. You may mistakenly package the
dist
directory repeatedly. electron-builderfiles
is required. You can verify it throughnpm create @quick-start/electron@latest
. There is no problem with the default electron-builder configuration.