做电子包装机时,请排除一些文件夹。 -阿萨尔 [英] Exclude some folders, while doing electron-packager . --asar

查看:56
本文介绍了做电子包装机时,请排除一些文件夹。 -阿萨尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用‘electron-packager。 --asar命令打包我的项目文件夹。但是有一些文件夹在包装时一定不能包括在内。

I use 'electron-packager . --asar' command to package my project folder. but there are some folders which must not be included while packaging.


  1. 是否可以排除某些文件夹?

  1. Is it possible to exclude some of folders?

如果是这样,我想在exe文件路径中包括这些文件夹,以便用户可以管理其文件。有什么办法吗?

If so, I would like to include those folders in exe file path so that the user can manage their files. Is there any way to do this?

谢谢!

推荐答案

是否可以排除某些文件夹?

是的,您可以使用 ignore


可以使用--ignore忽略文件和文件夹通过常规的
表达式(不是全局模式)。示例包括--ignore = .gitignore
或--ignore =。git(ignore | modules)。

You can use --ignore to ignore files and folders via a regular expression (not a glob pattern). Examples include --ignore=.gitignore or --ignore=".git(ignore|modules)".

这里

如果是这样,我想在exe文件路径中包括这些文件夹,以便用户可以管理其文件。

您可以使用 extraResource API将它们包括在资源目录(文档此处):

You can use extraResource API to include them to resources directory (document here):


额外资源

字符串或字符串数​​组

一个或多个文件直接复制到应用程序的
中OS X目标平台的Contents / Resources目录以及其他目标平台的
资源目录。

One or more files to be copied directly into the app's Contents/Resources directory for OS X target platforms, and the resources directory for other target platforms.

希望获得帮助。

这篇关于做电子包装机时,请排除一些文件夹。 -阿萨尔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆