bing code

Implementing Webpack for WordPress

WordPress has been moving heavily towards JavaScript which can be exciting for some and somewhat daunting for others. The implementation of the new ecosystem allows for a lot of more exciting things on the development side.

React, which is a JavaScript library for UI has become a frontrunner for WordPress development. Along with React, and the ability to harness the power of JavaScript, comes Webpack.

What is Webpack?

Webpack is an open-source JavaScript module bundler. I had mentioned React before, but Webpack can run on its own without using React. You don’t necessarily need to learn a ton of JavaScript to use Webpack, but it would behoove you to do so.

Webpack can also be used with HTML CSS and even images if properly set up. Webpack will make a dependency graph of all the asset and serve them up only when needed. Having the ability to bundle a ton of your code is one of the major benefits of webpack. Webpack can also be configured differently for each project.  With the ability to customize what assets are used when, Webpack delivers the necessary code and “forgets” the rest

Why Use Webpack?

The biggest advantage of using Webpack is that it will greatly increase the speed of your site.

Webpack will create a single JavaScript file with all your site’s JavaScript and CSS. With all the different WordPress plugins today, some websites can become very “code saturated”. Webpack will greatly enhance some of these larger sites.

Webpack can be a bit tricky to set up, but in the long run Webpack will prove to be worth the time.  Another reason to use Webpack is to familiarize yourself with the different tools at a developer’s disposal. There are quite a bit of tools you can implement to help your workflow and as a developer it is your duty to go out and find what makes your process easier.

Where do we go from here?

Webpack is something I will be testing out and implementing in our future website builds. It’s been on my agenda for a bit to test it out, and now I have some time to play around with it and test it out in a development environment. Another thing I like to do is try out new tools and tweak my workflow along the way. I believe Webpack will be an essential in future builds to allow for maximum performance.

Having the ability to play around in a development environment is one of the other benefits that allows some of these new tools to come into play. Webpack has been used a lot with other development but has made its way to WordPress.

Matt Walavich
Matt Walavich
Matt is a Web Developer on our team. Matt holds a certificate in Web Application Development and Programming from Fort Myers Technical College and is passionate about keeping up with ever-changing development trends, workflows, and updates to the different languages and frameworks that we use here at Atilus.

Leave a Comment

Recent Comments | 0 Comments
Recent Posts