Getting Started
This setup assumes that you have already installed the addon using
bash
composer require weloveyou/wly.wp.plugin.theme-extensionsThis will make the npm package available in the addon folder. The idea is that the npm package and the PHP code in the addon belong together very closely, so this approach make sure that the npm package always works with the backend code as well.
To install the npm package go the theme folder and run this:
bash
npm install ../../mu-plugins/wly.wp.plugin.theme-extensionsMake sure to run this command with at least node 20 and npm 10.
The package then provides a global RunThemeExtensions function to run the theme extensions. The different extensions will be explained on their dedicated pages. The general usage of this function is:
ts
import { RunThemeExtensions } from 'wly-theme-extensions';
RunThemeExtensions({
vue: {
enabled: true,
components: {
//
},
onBootstrap: (app) => {
//
},
},
});