JavaScript in WP Rig

JavaScript plays an ever more important role in web development, and we’re seeing more and more JavaScript in WordPress core and WordPress themes and plugins.

WP Rig itself doesn’t have much JavaScript included. There are three files: customizer.js, which relates to the customizer, lazyload.js, which helps put lazy loading of images, and navigation.js, which helps with accessibility for the main menu.

That said, WP Rig is ready for any JavaScript you want to create. The build process is configured for ES2015, aka ES6, aka ES.Next, with full ESLint support compiling via Babel and code minification, all out of the box, without any configuration on your part.

Like CSS, you build JavaScript in the assets.js source folder. The build process Lint compiles, optimizes, and minifies the code before placing it in the root js folder, ready for use by modern and older browsers.

In short, you write modern JavaScript. WP Rig makes sure it works everywhere.

More from this course: