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_scripts
folder. - Open
config.json
with your favorite editor. -
Change
name
to your theme name. eg:Xurais
orXu Rais
(Capitalized)."name": "Xurais",
-
Chang
global
to a friendly and short name. eg:xur
orxura
(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 variables
andglobal object (JavaScript)
according to yourconfig.json
file.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