app builder lib.Interface.FilesBuildOptions
Electron-Builder / app-builder-lib / FilesBuildOptions
扩展自¶
属性¶
extraFiles?¶
optional
extraFiles:null
|string
|FileSet
| (string
|FileSet
)[]
与 extraResources 相同,但复制到应用程序的内容目录中(MacOS 的 Contents
,Linux 和 Windows 的根目录)。
extraResources?¶
optional
extraResources:null
|string
|FileSet
| (string
|FileSet
)[]
相对于项目目录的 glob 模式,指定后,将具有匹配名称的文件或目录直接复制到应用程序的 resources 目录中(MacOS 的 Contents/Resources
,Linux 和 Windows 的 resources
)。
文件模式(以及对 from
和 to
字段的支持)与 files 相同。
files?¶
optional
files:null
|string
|FileSet
| (string
|FileSet
)[]
相对于 应用程序目录 的 glob 模式,指定在复制文件以创建包时要包含哪些文件。
默认为
[
"**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!.editorconfig",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}"
]
在任何情况下都不会复制开发依赖项。您无需显式忽略它。默认情况下不会忽略隐藏文件,但默认情况下会忽略所有应忽略的文件。
如果您的某些模式不是忽略模式(即不以 !
开头),则默认模式 **/*
不会添加到您的自定义模式中。在任何情况下,package.json
和 **/node_modules/**/*
(仅复制生产依赖项)都会添加到您的自定义模式中。所有默认忽略项都会在任何情况下添加 — 如果您配置了自己的模式,则无需重复它。
可以在平台选项中指定(例如,在 mac 中)。
您还可以通过使用 FileSet
对象而不是简单的 glob 模式来指定自定义源目录和目标目录。
[
{
"from": "path/to/source",
"to": "path/to/destination",
"filter": ["**/*", "!foo/*.js"]
}
]