-
-
Notifications
You must be signed in to change notification settings - Fork 391
Making a plugin
Alexander Buzin edited this page Sep 18, 2016
·
3 revisions
To make a plugin it is recommended to use generator-whs-plugin. There you can easily choose whether you will use Babel or not in your plugin, easily fill package.json
and bower.json
if needed.
- Make a new repository.
- Install Yeoman:
npm install -g yo
- Install Whitestorm.js plugin generator:
npm install -g generator-whs-plugin
(Github repo) - Run
yo whs-plugin
.
- Run
gulp dev
in repo folder. This will watch all files you edit in src (watched by webpack dev server) and automatically compile them in real-time. - Open http://localhost:8080/ in browser. Now you should see a basic plugin that creates dynamic sphere shape with green material.
- Edit files in src folder. All your changes should be compiled immediately.
- index.js is a main file. Your plugin will export the same as this file export.
As your package.json file is complete and plugin is written - you can publish it to NPM.
- Run
npm publish
. - Profit!
This command builds all sources for node.js and browser environment.
This command builds all sources only for node.js environment - lib/ folder
This command builds all sources only for browser environment - build/ folder.
This command runs development mode where you can make changes in sources and all your changes will be applied immediately. After running this command you should see all examples by http://localhost:8080/
Removes all files from build/ and lib/