下载tag包
解压应用,并使用vs code打开
shuchengyang@shuchengyang-x10dri:~/JSProject$ tar -zxvf electron-vite-vue-2.0.0.tar.gz electron-vite-vue-2.0.0/ electron-vite-vue-2.0.0/.github/ electron-vite-vue-2.0.0/.github/ISSUE_TEMPLATE/ electron-vite-vue-2.0.0/.github/ISSUE_TEMPLATE/bug_report.md electron-vite-vue-2.0.0/.github/ISSUE_TEMPLATE/help_wanted.md electron-vite-vue-2.0.0/.github/PULL_REQUEST_TEMPLATE.md electron-vite-vue-2.0.0/.github/dependabot.yml electron-vite-vue-2.0.0/.github/workflows/ electron-vite-vue-2.0.0/.github/workflows/build.yml electron-vite-vue-2.0.0/.github/workflows/ci.yml electron-vite-vue-2.0.0/.gitignore electron-vite-vue-2.0.0/.vscode/ electron-vite-vue-2.0.0/.vscode/.debug.script.mjs electron-vite-vue-2.0.0/.vscode/extensions.json electron-vite-vue-2.0.0/.vscode/launch.json electron-vite-vue-2.0.0/.vscode/settings.json electron-vite-vue-2.0.0/.vscode/tasks.json electron-vite-vue-2.0.0/CHANGELOG.md electron-vite-vue-2.0.0/LICENSE electron-vite-vue-2.0.0/README.md electron-vite-vue-2.0.0/electron-builder.json5 electron-vite-vue-2.0.0/electron/ electron-vite-vue-2.0.0/electron/electron-env.d.ts electron-vite-vue-2.0.0/electron/main/ electron-vite-vue-2.0.0/electron/main/index.ts electron-vite-vue-2.0.0/electron/preload/ electron-vite-vue-2.0.0/electron/preload/index.ts electron-vite-vue-2.0.0/index.html electron-vite-vue-2.0.0/package.json electron-vite-vue-2.0.0/public/ electron-vite-vue-2.0.0/public/electron-vite-vue.gif electron-vite-vue-2.0.0/public/favicon.ico electron-vite-vue-2.0.0/public/node.png electron-vite-vue-2.0.0/src/ electron-vite-vue-2.0.0/src/App.vue electron-vite-vue-2.0.0/src/assets/ electron-vite-vue-2.0.0/src/assets/electron.svg electron-vite-vue-2.0.0/src/assets/vite.svg electron-vite-vue-2.0.0/src/assets/vue.svg electron-vite-vue-2.0.0/src/components/ electron-vite-vue-2.0.0/src/components/HelloWorld.vue electron-vite-vue-2.0.0/src/env.d.ts electron-vite-vue-2.0.0/src/main.ts electron-vite-vue-2.0.0/src/samples/ electron-vite-vue-2.0.0/src/samples/node-api.ts electron-vite-vue-2.0.0/tsconfig.json electron-vite-vue-2.0.0/tsconfig.node.json electron-vite-vue-2.0.0/vite.config.ts shuchengyang@shuchengyang-x10dri:~/JSProject$ ls electron-vite-vue-2.0.0 electron-vite-vue-2.0.0.tar.gz shuchengyang@shuchengyang-x10dri:~/JSProject$
使用vs code打开目录,此时由于vs code未安装插件,会安装相应插件
4.build 项目
首先初始化npm
npm install
shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ npm install npm WARN deprecated asar@3.2.0: Please use @electron/asar moving forward. There is no API change, just a package name change npm WARN deprecated electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different (##################) ⠏ reify:typescript: http fetch GET 200 https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz 34585ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) (##################) ⠙ reify:@esbuild/linux-x64: http fetch GET 200 https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz 183461ms (cache miss) added 288 packages, and audited 289 packages in 9m 29 packages are looking for funding run `npm fund` for details 9 vulnerabilities (3 moderate, 6 high) To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ npm install up to date, audited 289 packages in 5s 29 packages are looking for funding run `npm fund` for details 9 vulnerabilities (3 moderate, 6 high) To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. shuchengyang@shuchengyang-x10dri:~/JSProject/electron-vite-vue-2.0.0$ npm run build > electron-vue-vite@2.0.0 build > vue-tsc --noEmit && vite build && electron-builder vite v3.2.7 building for production... ✓ 19 modules transformed. dist/vite.4a748afd.svg 1.46 KiB dist/vue.5532db34.svg 0.48 KiB dist/electron.d1c5c991.svg 2.38 KiB dist/index.html 0.60 KiB dist/style.428598c2.css 0.66 KiB / gzip: 0.39 KiB dist/index.0f3cdefc.js 50.66 KiB / gzip: 20.48 KiB vite v3.2.7 building for production... ✓ 1 modules transformed. dist-electron/main/index.js 1.56 KiB / gzip: 0.78 KiB vite v3.2.7 building for production... ✓ 1 modules transformed. dist-electron/preload/index.js 1.54 KiB / gzip: 0.74 KiB • electron-builder version=23.6.0 os=5.10.0-8-generic • loaded configuration file=/home/shuchengyang/JSProject/electron-vite-vue-2.0.0/electron-builder.json5 • writing effective config file=release/2.0.0/builder-effective-config.yaml • packaging platform=linux arch=x64 electron=21.4.4 appOutDir=release/2.0.0/linux-unpacked • downloading url=https://npm.taobao.org/mirrors/electron/21.4.4/electron-v21.4.4-linux-x64.zip size=91 MB parts=8 • downloaded url=https://npm.taobao.org/mirrors/electron/21.4.4/electron-v21.4.4-linux-x64.zip duration=9.113s • building target=snap arch=x64 file=release/2.0.0/electron-vue-vite_2.0.0_amd64.snap • building target=AppImage arch=x64 file=release/2.0.0/electron-vue-vite-2.0.0.AppImage • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux • default Electron icon is used reason=application icon is not set • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux • downloading url=https://npm.taobao.org/mirrors/electron-builder-binaries/snap-template-4.0-2/snap-template-electron-4.0-2-amd64.tar.7z size=1.5 MB parts=1 • downloading url=https://npm.taobao.org/mirrors/electron-builder-binaries/appimage-12.0.1/appimage-12.0.1.7z size=1.6 MB parts=1 • downloaded url=https://npm.taobao.org/mirrors/electron-builder-binaries/appimage-12.0.1/appimage-12.0.1.7z duration=758ms • downloaded url=https://npm.taobao.org/mirrors/electron-builder-binaries/snap-template-4.0-2/snap-template-electron-4.0-2-amd64.tar.7z duration=830ms
最后生成应用程序包:
这里我们使用离线包验证:
还没有评论,来说两句吧...