Includes a Gulp task that will watch the JavaScript and SCSS files and automatically build (compile, concat, minify, etc) them when they change. To set this up, perform the following steps:
- Install Node.js and NPM
- place
package.json
andgulpfile.js
in your WP theme directory (eg. wp-content/themes/my-theme) - Navigate in your terminal to your theme directory
- Install dependencies: npm install
- Install the Gulp CLI: npm install -g gulp-cli
- Run the Gulp watch task: gulp
Note: the generated style.css
and js/application.js
files in the theme should never be updated manually. They are generated from the individual SCSS and JS/Coffeescript files, respectively. The SCSS source lives in styles; the JS, in js/source.