简体   繁体   中英

How to deploy a WordPress Theme that is using webpack for bundling?

I used to developed WordPress themes in the early 2010's but I am now really out of fashion, especially with things like Webpack and npm .

I am following a tutorial and I have already finished my theme. Webpack bundles an assets folder with the production files. However, the src folder, package-lock.json and webpack.config.js are still in the root folder.

I know by common sense, but not pretty sure, that those files shouldn't be there since that's the reason of the bundling process. How do I distribute my template and further plugins or even React apps without sharing de src files and only the bundled and minified ones?

Here is the awesome tutorial for using Webpack and WordPress together.

https://wptips.dev/webpack-in-wordpress/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM