packtor
v2.0.0
Published
Copy files and folders to a directory and create its zip.
Maintainers
Readme
packtor
Copy files and folders to a directory and create a zip.
Install
npm install --save-dev packtorUsage
Add a .packtorrc.json to your project root:
{
"destFolder": "deploy",
"createZip": true,
"files": [
"src/**/*",
"includes/**/*",
"*.php",
"readme.txt",
"!src/tests/**/*"
]
}Add a script to package.json:
"scripts": {
"pack": "packtor"
}Options
| Option | Default | Description |
| --- | --- | --- |
| destFolder | deploy | Output directory (always excluded from copy). |
| createZip | true | Create a zip of the copied files. |
| files | ['**/*'] | Whitelist of glob patterns to copy. Prefix with ! to exclude. |
The following are always excluded regardless of files: node_modules, .git, and destFolder.
Migrating from v1
Move the packtor key from package.json into a new .packtorrc.json file.
Before (package.json):
"packtor": {
"files": [
"**/*",
"!*.js",
"!package.json",
"!*.lock"
]
}After (.packtorrc.json):
{
"files": [
"src/**/*",
"includes/**/*",
"*.php",
"readme.txt"
]
}