Merge pull request #1706 from lixinyang123/master

解决 pkg 打包后无法运行
This commit is contained in:
binaryify 2023-02-22 09:19:24 +08:00 committed by GitHub
commit 23cceebdbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ node_modules
.vscode .vscode
.history .history
examples/moddef.json examples/moddef.json
bin

View File

@ -8,16 +8,28 @@
"lint": "eslint \"**/*.{js,ts}\"", "lint": "eslint \"**/*.{js,ts}\"",
"lint-fix": "eslint --fix \"**/*.{js,ts}\"", "lint-fix": "eslint --fix \"**/*.{js,ts}\"",
"prepare": "husky install", "prepare": "husky install",
"pkgwin": "pkg . -t node14-win-x64 -o app", "pkgwin": "node_modules/.bin/pkg . -t node14-win-x64 -C GZip -o bin/app --no-bytecode",
"pkglinux": "pkg . -t node14-linux-x64 -o app", "pkglinux": "node_modules/.bin/pkg . -t node14-linux-x64 -C GZip -o bin/app --no-bytecode",
"pkgmacos": "pkg . -t node14-macos-x64 -o app" "pkgmacos": "node_modules/.bin/pkg . -t node14-macos-x64 -C GZip -o bin/sapp --no-bytecode"
}, },
"bin": "./app.js", "bin": "./app.js",
"pkg": { "pkg": {
"scripts": "module/*.js", "scripts": "module/*.js",
"assets": [ "assets": [
"/node_modules/vm2/lib/contextify.js", "node_modules/axios",
"/public" "node_modules/express",
"node_modules/express-fileupload",
"node_modules/md5",
"node_modules/music-metadata",
"node_modules/pac-proxy-agent",
"node_modules/qrcode",
"node_modules/safe-decode-uri-component",
"node_modules/tunnel",
"node_modules/yargs",
"node_modules/tslib",
"node_modules/vm2",
"module",
"public"
] ]
}, },
"keywords": [ "keywords": [
@ -77,6 +89,7 @@
"intelli-espower-loader": "1.1.0", "intelli-espower-loader": "1.1.0",
"lint-staged": "12.1.7", "lint-staged": "12.1.7",
"mocha": "10.0.0", "mocha": "10.0.0",
"pkg": "^5.8.0",
"power-assert": "1.6.1", "power-assert": "1.6.1",
"prettier": "2.7.1", "prettier": "2.7.1",
"typescript": "4.5.2" "typescript": "4.5.2"