corradomatt
corradomatt

Reputation: 186

Webpack with WordPress Plugins, what's the best way?

I understand webpack (at least enough to get me into trouble). How could a WordPress plugin author build modular plugins (ie one plugin extends another) that utilizes webpack in the most efficient manner possible?

I would think that if I created Plugin-A using webpack and then created Plugin-B, which extends Plugin-A, also with webpack, that a certain amount of the bundled JS would be duplicated between the plugins.

It would be ideal if I could dynamically append to the webpack config from Plugin-A when Plugin-B loads.

Is there a built in method of making something like this work with webpack?

Upvotes: 1

Views: 215

Answers (1)

Priyanka Modi
Priyanka Modi

Reputation: 1624

It's new functionality for wordpress. So, you have go though the article,

Webpack into a WordPress theme

And Also Learn the Webpack

Hope that you can use for your development

Upvotes: 1

Related Questions