Skip to content

Setting up the Development Environment

Thomas Park edited this page Sep 19, 2015 · 1 revision

Initial Setup

These instructions are for setting up the development environment for Snowball.

  • If you are reading this, I'm assuming you have git installed.
    • If you don't, please install git.
  • Once you have that, git clone this repository.
    • To test this plugin and develop at the same time, I recommend putting this repository into the Wordpress plugins directory, which is located in: /path/to/wordpress/wp-content/plugins/

Installing Dependencies

You must have npm (Node Package Manager) installed, which is part of Node.js. You can install from here.

To install all the dependencies needed:

npm install

Or if you might be missing some new additional packages, use this command:

npm update

The list of packages is listed in packages.json.

Running Gulp

You must run gulp to minify Snowball's JS and CSS files. You can leave gulp running to watch and automatically minify the files as you edit.

Watch and minify files:

gulp

Commands that can be run individually without needing to be watched

Minify just the CSS files:

gulp minify-snowball-css

Minify just the JS files:

gulp minify-snowball-js

Minify the CSS and JS in the CodeMirror and Fixed Sticky libraries:

gulp minify-libraries

Minify just the CodeMirror library:

gulp minify-codemirror

Zipping Snowball

To install Snowball as a WordPress plugin, you must zip the project directory and upload to WordPress.

Zip Snowball with only essential files:

gulp zip

Git Merge Conflicts for Minified Files

If there are merge conflicts for the minified files, fix the conflicts in the non-minified files first, then run gulp to minify them all to the version you want.

Clone this wiki locally