| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A modular theme.json compiler for WordPress themes.
⚠️ Warning
The compile and watch commands will overwrite your theme.json file in the specified theme directory.
A backup is created automatically, but you may want to manually make one as well since this tool has not been thoroughly tested yet.
npm install @builtnorth/wp-theme-json-compilernpx @builtnorth/wp-theme-json-compiler compile --theme-path=wp-content/themes/your-theme npx @builtnorth/wp-theme-json-compiler split --theme-path=wp-content/themes/your-theme npx @builtnorth/wp-theme-json-compiler watch --theme-path=wp-content/themes/your-theme
Add to your root package.json scripts:
"theme-json:compile": "wp-theme-json-compiler compile --theme-path=wp-content/themes/your-theme", "theme-json:split": "wp-theme-json-compiler split --theme-path=wp-content/themes/your-theme", "theme-json:watch": "wp-theme-json-compiler watch --theme-path=wp-content/themes/your-theme"
Before overwriting your existing theme.json, the compiler automatically creates a backup named theme.backup.json in the same theme directory. This occurs every time you run the compile command, and once per session when using the watch command (the first time a change is detected).
Thanks to Nick Diego's article on managing theme.json files that came up in search results when looking into spitting up a monolithic theme.json file.
This tool is provided "as is" without warranty of any kind, express or implied. Use at your own risk. Tool will override currenth theme.json files, so please understand that and/or have a backup. The authors and contributors are not responsible for any damages or liabilities arising from the use of this library. Always test thoroughly in your specific environment before deploying to production.
GNU General Public License version 2 (or later) (GPLv2)
| Back | FazBrowse Home | New Git URL |