Download the PHP package codesvault/wp-bundler without Composer
On this page you can find all versions of the php package codesvault/wp-bundler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codesvault/wp-bundler
More information about codesvault/wp-bundler
Files in codesvault/wp-bundler
Package wp-bundler
Short Description WP Bundler is a CI/CD tool. It can configure and run build process, and bundle zip(s) for WordPress plugins.
License MIT
Informations about the package wp-bundler
WP Bundler
Build dependencies & Bundle production ready plugin.
WP Bundler is a CI/CD tool. It can configure and run build process, and bundle zip(s) for WordPress plugins.
Requirements
- Environment: Mac, Linux.
- PHP CLI 7.4 >=
- Composer
Installation
It is required to use composer to install WP Bundler.
Setup
Create a bundler
file in the root folder of your plugin. E.g. wp-content/plugins/kathamo/bundler
.
Add the below code in the file.
Make a .distignore
file in the root folder of your plugin. Add all those files, folders which you want to exclude from the production zip like below.
Uses
Now Let's add build pipeline in the above bundler
file using this codes. Then from terminal cd
into plugin's folder and run the below command to create a production zip.
It's creating a repo in the /pluginName/prod
folder then running build command
then 'cleaning' up the repo based on .distignore
and finally making a zip.
Envirnoment variables
Get env file data using WP Bundler.
Update File content
You can also update specific file data dynamically before making the zip using updateFileContent
api.
Configuration
Create a bundler-schema.json
file in the root folder of your plugin.
bundler-schema.json
file data structure will be like below.
Here Kathamo, README
these keys are the file names. path
is the file's relative path. extension
is the file extension. schema
is the array of objects where target
is the data which you want to update and template
is the data which you want to replace with.
Usage
Find and Replace
Update entire plugin file's data using findAndReplace
api.
Multiple Zips
When you want to create multiple zip, use buildIterator
api.
Example
Here is an example of a bundler
file.