Site icon TheDevCouple

Webpack Makes It to the WordPress Core as A JS Bundle Manager

Webpack Makes It to the WordPress Core as A JS Bundle Manager 2 Community

In late 2014, to split JavaScript files into maintainable modules, Browserify was introduced. Recently, WordPress is rapidly moving towards JavaScript.

A significant part of Gutenberg is composed of JavaScript. So, it is quite obvious to take a step towards the latest bundle manager available for JavaScript.

That’s why Adam Silverstein proposed to replace Browserify with Webpack four months ago.

While Browserify has served us well, Webpack is probably a better long-term choice for the project, especially with the introduction of a new JavaScript framework that may require a build.

— Use Webpack instead of Browserify for build process

WordPress contributors made this decision four months ago. They even reached out to the contributors of Webpack for their review.

🏆 After four months of hard work, the ticket finally made it to WordPress core on October 4th, 2017.

🎉 Kudos to the contributors who made it all possible.

🤔 What is a Bundle Manager?

To put in simple words, a bundle manager lets you use all of your project dependencies in the browser. It can also perform some other tasks like minifying, linting, testing, etc. Browserify and Webpack are the names of bundle managers for JavaScript.

WordPress used to have Browserify to maintain its JS components. Webpack replaced it last week.

Here are some of the qualities of Webpack which made it a more natural choice.

✔︎ Pros of Using Webpack

It is imminent that a JavaScript framework might land in WordPress core. So, Webpack looks like a smart choice to have around when that happens.

Do you think it was a smart decision? Let us know in the comments.

Exit mobile version