Exclude some folders, while doing electron-packager . --asar

我是研究僧i 提交于 2019-12-19 10:44:20

问题


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

  1. Is it possible to exclude some of folders?

  2. 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?

Thank you in advance!


回答1:


Is it possible to exclude some of folders?

Yes, you can do it with ignore

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)".

Take a look at API document here

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?

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

extraResource

String or Array of Strings

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.

Hope this help.



来源:https://stackoverflow.com/questions/53587974/exclude-some-folders-while-doing-electron-packager-asar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!