用electrion打包angular成桌面应用
2024-08-29 22:15:48
用electrion官网的不行。
还好,可以直接照搬 https://github.com/maximegris/angular-electron
安装必要的库
npm i --save-dev electron electron-builder electron-reload npm-run-all wait-on
需要从angular-electron 里复制出来:
./下的
main.ts
tsconfig.json
tsconfig.app.json
tsconfig-serve.json
postinstall.js
postinstall-web.js
electron-builder.json
需要参考修改的: 懒得修改,直接照搬
package.json
"main": "main.js", //增加 "scripts": {
"postinstall": "npm run postinstall:electron && electron-builder install-app-deps",
"postinstall:web": "node postinstall-web",
"postinstall:electron": "node postinstall",
"ng": "ng",
"start": "npm run postinstall:electron && npm-run-all -p ng:serve electron:serve",
"build": "npm run postinstall:electron && npm run electron:serve-tsc && ng build",
"build:dev": "npm run build -- -c dev",
"build:prod": "npm run build -- -c production",
"ng:serve": "ng serve",
"ng:serve:web": "npm run postinstall:web && ng serve -o",
"electron:serve-tsc": "tsc -p tsconfig-serve.json",
"electron:serve": "wait-on http-get://localhost:4200/ && npm run electron:serve-tsc && electron . --serve",
"electron:local": "npm run build:prod && electron .",
"electron:linux": "npm run build:prod && electron-builder build --linux",
"electron:windows": "npm run build:prod && electron-builder build --windows",
"electron:mac": "npm run build:prod && electron-builder build --mac",
"test": "npm run postinstall:web && ng test",
"e2e": "npm run build:prod && mocha --timeout 300000 --require ts-node/register e2e/**/*.spec.ts",
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"lint": "ng lint"
},
最新文章
- 返水bug-中澳
- Mongodb在windows下的安装和启动
- python __file__ 与相对路径
- cocos2d 定时器
- IE9的css hack
- linux之使用cron,logrotate管理日志文件
- 安装PIL库时提示python未注册错误(自定义python安装路径)
- mysql中enum的用法
- Android JNI环境要SQLite加密模块简介
- 深入理解Linux内核 学习笔记(4)
- Elasticsearch-6.7.0系列(四)Metricbeat仪表盘。本身无端口,依赖kibana
- 通用base.css —— 《编写高质量代码 web前端开发修炼之道》
- luogu P2515 [HAOI2010]软件安装
- 论文笔记系列-Simple And Efficient Architecture Search For Neural Networks
- 【转】Windows下selenium+python自动化测试环境搭建
- 第 8 章 容器网络 - 053 - overlay 是如何隔离的?
- Codeforces731C(SummerTrainingDay06-M 并查集)
- 项目中使用protobuf
- halcon之共线连接union_collinear_contours_xld
- Android -- 网络图片查看器,网络html查看器, 消息机制, 消息队列,线程间通讯