WordPress starter child theme generator with Sass preprocessor, JavaScript minifier, Image optimizer, Gulp task runner
- Run
$ gulp -v
to check requirments - Check for outdated npm packages
$ npm outdated
- Recommended CLI version 2.0.1 & Local version 4.0.0
- ICE try to run
$ npm audit fix
and in extreme faulty scenarios$ npm audit fix --force
If there are issues with Gulp versions, commonly mismatch between local and global gulp-cli, please try these steps:
- uninstall gulp globally
$ npm uninstall gulp -g
$ npm uninstall gulp-cli -g
it might require to remove manually previuous version folders
- uninstall locally from your project directory, or delete node_modules
$ ./your-local-folder/~ npm uninstall gulp
$ ./your-local-folder/~ rm -rf node_modules/
- install the latest Gulp 4 CLI tools globally
npm install gulpjs/gulp-cli -g
source: https://github.com/pattern-lab/edition-node-gulp/wiki/Updating-to-Gulp-4
Wordpress Starter child-theme sass-gulp has been tested on Mac and Windows, not yet on Linux.
This child-theme generator is still a work in progress, so code comments and // debug
are still visible
$ git clone https://github.com/giorgioriccardi/wordpress-starter-child-theme-sass-gulp.git
$ npm install
$ gulp watch
- run
$ gulp js
only to minify/uglifyapp.js
- run
$ gulp images
only to optimize images in theimages/src
folder - run
$ gulp
to run all the above tasks
Write app.js
code into js/src
folder
Functions.php
has already a function to enqueue the minified version of your js
get_stylesheet_directory_uri() . '/js/app.min.js'
Place images into images/src
folder
Optimized images will be created into images/distt
folder
- Review
gulp-uglify-es
vs.terser
(https://www.npmjs.com/package/terser) - Fix
gulp-util
is deprecated (https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5) - Update dependencies
es6-promise 3.1.2->4.2.5
gulp-autoprefixer 3.1.1->6.0.0
gulp-sass 2.3.2->4.0.2
improve and speed-up dependencies buildTestgulp 4.0.0
(right now throws an error) vs.gulp 3.9.1
that works finegulp 3.9.1->4.0.0
browserSync.reload
stops recursive tasksError withCLI version 3.9.1
- Clean-up messy code and comments
Re-organize modules order- Test on Linux
The Js & Sass folders come with some functions, modules, variables, breakpoints and mixins.
They are there just as a reference and they should be deleted and/or customized to fit your project needs upon bundle build.