Subscribe to our Premium Bi-Monthly WPTakeaway Newsletter by WPCouple! What is WPTakeaway?

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

  • Webpack is easy to implement.
  • Webpack does not require automation scripts like Gulp or Grunt.
  • It has a single configuration file for the entire build process.
  • Webpack provides automation tasks like minification out of the box.
  • It also supports live reloading.
  • And it does all of these tasks without requiring help from the outside scripts.

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.

🙌

SUBSCRIBE TO WORDPRESS TAKEAWAY!

A Premium Bi-Monthly Newsletter by WPCouple! What is WPTakeaway?

There are currently no comments.

🙌 You must have something to say here...