Open tajmone opened 3 years ago
The Creating Package Files page of the Package Control documentation mentions various Package Profiles settings that allow to exclude certain files and folders from the final .sublime-package
archive (packed package):
dirs_to_ignore
— A list of folders to ignore when creating a .sublime-package
file.files_to_ignore
— A list of file glob patterns to ignore when creating a .sublime-package
file by the Create Package command.The instructions are for custom repository hosting instead of using GitHub or BitBucket, so I don't think they apply to normal packages delivered by Package Control — there doesn't seem to be an equivalent settings file for a package repository intended to be delivered via the official channel.
Profiles refer to the Package Control package that's bundled with ST, i.e. settings that the users can tweak via the Preferences » Package Settings » Package Control » Settings – Default/User menus.
The file allows a package_profiles
setting:
package_profiles
— The key of the object will be the profile name and a list of them will be presenting when running the "Create Package File" command. The profile "Default" will use the top-level version on the following settings:E.g., this is the default profile:
{
"Binaries Only": {
// Exclude all .py files, but consequently include all .pyc files
"files_to_ignore": [
"*.py", ".hgignore", ".gitignore", ".bzrignore",
"*.sublime-project", "*.sublime-workspace", "*.tmTheme.cache"
],
// Include __init__.py so Sublime Text will load the package
"files_to_include": [
"__init__.py"
]
}
}
Add a
_dev/
folder to collect developers and maintainers' assets and documents, which should be excluded from the final package shipped via Package Control._dev/
folder.I'm not sure whether it's possible to exclude some files and folders from the final packed package on Package Control. I have a vague recollection that there used to be some JSON settings to handle this, but I might be wrong or this might no longer be the case.
Devs/maintainers' assets don't really need to be included in the auto-installed package, it's a waste of space; they should only be available when cloning the repository via Git.