Presets allow you to define multiple packaging configurations in a single .packaide.json file. Each preset can override base configuration options, making it easy to create different builds for different scenarios.
- Base Configuration: Define your default/common settings at the root level
- Presets: Define named configurations that override base settings
- Usage: Run packaide with a specific preset using the
--presetflag
{
"outputPath": "release",
"folders": ["src", "public", "themes"],
"files": ["index.html"],
"exclude": [],
"include": ["**/*"],
"archiveAfterCopy": true,
"archiveName": "webapp-default",
"presets": {
"preset-name": {
"outputPath": "release-custom",
"exclude": ["themes/dark/**"],
"archiveName": "webapp-preset"
}
}
}These are your default settings that apply when no preset is specified:
outputPath- Where to output packaged filesfolders- Array of folders to includefiles- Array of individual files to includeexclude- Array of glob patterns to excludeinclude- Array of glob patterns to includearchiveAfterCopy- Whether to create a ZIP archivearchiveName- Name of the archive fileftp- FTP upload configuration
Each preset can override any base configuration property. Only include the properties you want to override.
{
"outputPath": "release",
"folders": ["src", "public", "themes", "assets"],
"files": ["index.html", "package.json"],
"exclude": [],
"include": ["**/*"],
"archiveAfterCopy": true,
"archiveName": "webapp-default",
"presets": {
"light-theme": {
"exclude": [
"themes/dark-theme/**",
"themes/admin-theme/**"
],
"archiveName": "webapp-light",
"outputPath": "release-light"
},
"dark-theme": {
"exclude": [
"themes/light-theme/**",
"themes/admin-theme/**"
],
"archiveName": "webapp-dark",
"outputPath": "release-dark"
},
"admin-only": {
"folders": ["src/admin", "themes/admin-theme"],
"exclude": ["themes/light-theme/**", "themes/dark-theme/**"],
"archiveName": "webapp-admin"
},
"production": {
"exclude": [
"**/test/**",
"**/*.test.js",
"**/*.spec.js",
"**/docs/**"
],
"archiveAfterCopy": true,
"archiveName": "webapp-production"
}
}
}packaide copyUses the base configuration (root level settings).
packaide copy --preset light-theme
packaide copy -p dark-themepackaide upload --preset production
packaide upload -p admin-only{
"folders": ["app", "public", "themes"],
"exclude": [],
"archiveName": "ecommerce-site",
"presets": {
"summer-sale": {
"exclude": ["themes/winter/**", "themes/halloween/**"],
"archiveName": "ecommerce-summer"
},
"winter-sale": {
"exclude": ["themes/summer/**", "themes/halloween/**"],
"archiveName": "ecommerce-winter"
},
"black-friday": {
"exclude": ["themes/summer/**", "themes/winter/**"],
"archiveName": "ecommerce-blackfriday"
}
}
}Usage:
packaide copy --preset summer-sale
packaide copy --preset winter-sale
packaide copy --preset black-friday{
"folders": ["src", "assets", "themes"],
"files": ["index.html"],
"archiveName": "app-generic",
"presets": {
"client-a": {
"folders": ["src", "assets", "themes/client-a"],
"exclude": ["themes/client-b/**", "themes/client-c/**"],
"archiveName": "app-client-a",
"outputPath": "builds/client-a"
},
"client-b": {
"folders": ["src", "assets", "themes/client-b"],
"exclude": ["themes/client-a/**", "themes/client-c/**"],
"archiveName": "app-client-b",
"outputPath": "builds/client-b"
}
}
}{
"folders": ["src", "public"],
"files": ["index.html", "package.json"],
"presets": {
"development": {
"exclude": [],
"archiveAfterCopy": false,
"outputPath": "dev-build"
},
"staging": {
"exclude": ["**/test/**", "**/*.test.js"],
"archiveAfterCopy": true,
"archiveName": "app-staging",
"outputPath": "staging-build"
},
"production": {
"exclude": [
"**/test/**",
"**/*.test.js",
"**/*.spec.js",
"**/docs/**",
"**/.env.development"
],
"archiveAfterCopy": true,
"archiveName": "app-production",
"outputPath": "production-build"
}
}
}Usage:
packaide copy --preset development
packaide copy --preset staging
packaide copy --preset production- Preset values always override base values
- Only specified properties are overridden - other properties use base values
- Arrays are completely replaced - not merged
- Nested objects (like
ftp) can be partially overridden
Config:
{
"folders": ["src", "public", "themes"],
"exclude": ["**/node_modules/**"],
"archiveName": "default",
"presets": {
"minimal": {
"folders": ["src"],
"archiveName": "minimal-build"
}
}
}Result when using --preset minimal:
folders:["src"]← Overriddenexclude:["**/node_modules/**"]← Inherited from basearchiveName:"minimal-build"← Overridden
If you run with a non-existent preset, packaide will show available presets:
packaide copy --preset nonexistentOutput:
Preset 'nonexistent' not found in config.
Available presets: light-theme, dark-theme, admin-only, production
- Use base config for common settings - Put shared configuration at the root level
- Keep presets focused - Only override what's different
- Use descriptive names - Make preset names self-explanatory
- Test each preset - Verify each preset produces the expected output
- Document your presets - Add comments in your config (outside JSON) or in README
- Presets are perfect for multi-tenant applications
- Use presets for different deployment environments
- Create presets for different client builds
- Combine presets with exclude/include patterns for maximum flexibility
- Each preset can have its own
outputPathto avoid overwriting builds
✅ Multiple theme variations
✅ Client-specific customizations
✅ Environment-based builds (dev/staging/prod)
✅ Feature-toggled builds
✅ Regional/localized versions
✅ Different package sizes (full/lite versions)
# Development - quick build without archiving
packaide copy --preset development
# Test build for client A
packaide copy --preset client-a
# Production build with all optimizations
packaide copy --preset production
# Upload staging build to FTP
packaide upload --preset stagingThat's it! Presets make it easy to manage multiple build configurations in one place. 🎉