![]() ![]() ![]() Our theme folder structure will look like this: themefolder/ ES6, ES7, etc.) into ES5 in order to support older browsers. Secondly, let’s assume that our primary goal is to create tasks that help manage our assets, like minify our CSS and JavaScript files, compile Sass to CSS, and transpile modern JavaScript syntax (e.g. Sure, most themes are likely to include many more files that this, but that’s not important right now. So, how can we use Gulp to power the tasks for a WordPress theme? First off, let’s assume our theme only contains the two files that WordPress requires for any theme: index.php and styles.css. We’ll cover the initial setup for now, but then go super in-depth on the tasks themselves in another post. So, we’re going to set Gulp up to do a lot of the heavy lifting for WordPress theme development. Also, Gulp is a bit faster than Grunt because of those Node streams and faster is always a good thing to me! It uses Node streams to manipulate files and JavaScript functions to write the tasks, whereas Grunt uses a configuration object to define tasks - which might be fine for some, but is something that made me a little uncomfortable. I went with Gulp after a good amount of research, it appeared to have an intuitive way to write tasks. ![]() The two most popular task runners powered by Node are Gulp and Grunt. I ended up using that task runner to automate a lot of other tasks that made the theme much more efficient and scalable. During the process, I wanted to use a task runner to concatenate and minify JavaScript and CSS files. If you’re interested in how the tasks are created, then stay tuned for part two.Įarlier this year, I created a course for building premium WordPress themes. This first part covers a lot of ground for the initial setup, including Gulp installation and an outline of the tasks we want it to run. This is the first part of a two-part series on creating a Gulp workflow for WordPress theme development. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |