[英]How can I package my express app assets and scripts properly with zeit/pkg
I'm trying to package my express app with pkg on Windows 10.我正在尝试在 Windows 10 上使用 pkg 打包我的 express 应用程序。
When I package the app like so:当我像这样打包应用程序时:
pkg package.json -t node10-latest-win-x64 -o webapp-win
the executable in the app directory works fine. app 目录中的可执行文件工作正常。
But I want to ship the app without my sources and configurations.但我想在没有我的来源和配置的情况下发布应用程序。 Therefor my package.json looks like the following:
因此,我的 package.json 如下所示:
"pkg": {
"scripts": [
"config/config.js",
"require.js",
"controllers/**/*.js",
"migrations/**/*.js",
"models/**/*.js",
"routes/**/*.js",
"public/javascript/**/*.js"
],
"assets": [
"views/**/*",
"public/assets/css/**/*.css",
"public/assets/webfonts/**/*",
"public/images/**/*.ico",
"public/stylesheets/**/*.css",
".sequelizerc",
"bin/**/*",
"config/config.json"
]
The packaging again works fine and the executable works in the app directory.打包再次正常工作,可执行文件在 app 目录中工作。 But when I trie to use it without say the config directory or the views directory it fails.
但是当我尝试使用它而不说 config 目录或 views 目录时,它失败了。
When I attach the --debug flag to the packaging it says: [debug] Stat info of %1 is added to queue
and [debug] Content of %1 is added to queue
for every file defined in the assets and scripts.当我将 --debug 标志附加到包装上时,它说:
[debug] Stat info of %1 is added to queue
而[debug] Content of %1 is added to queue
在资产和脚本中定义的每个文件的[debug] Content of %1 is added to queue
中。 I'm not sure what that means.我不确定这意味着什么。
I'd be greatefull for every help I can get.对于我能得到的每一个帮助,我都会很高兴。 I am really stuck.
我真的被困住了。 Thanks
谢谢
只需添加--config package.json
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.