Let's Start
Get Starter Plugin
Download fresh copy of Xe Plugin and extract it to you development environment. Change folder name to your theme name. e.g: xurais or xu-rais.
Install Nodejs
Nodejs is a JavaScript runtime built on Chrome's V8 JavaScript engine. Install the latest version from their website if you don't have it installed already. You can check Nodejs version using the following command.
node -v
You can check npm version using the following command.
npm -v
Initialization
- Navigate to
node_scriptsfolder. - Open
config.jsonwith your favorite editor. -
Change
nameto your theme name. eg:XuraisorXu Rais(Capitalized)."name": "Xurais", -
Chang
globalto a friendly and short name. eg:xurorxura(Lowercase)."global": "xur", -
Open command line, navigate to project folder and run this command to install dependencies:
npm install -
Now run following command to automatically change
text-domain,prefixes,DocBlocks,global variablesandglobal object (JavaScript)according to yourconfig.jsonfile.npm run init
Build
Open config.json inside node_scripts folder and change build path to your desired location.
"build": "E:/Projects/Xe Plugin",
Once you have completed your plugin, run the below command to generate a clean copy. .pot file will also be generated inside languages folder.
npm run build