Using the Parcel build tool with WordPress

I’ve been looking into build tools lately, specifically stuff that allows PostCSS, and would therefore enable to create a build process that among other things would automatically autoprefix, minify and concatenate my WordPress site.

It seems that one of the more current tools for this purpose is Parcel, which also boasts a zero-configuration file approach and therefore has the advantage of being the easiest to get started with.

However, Parcel seems to require an index.html file as an “entry file” to get started with it, and I’m unsure how this would work with WordPress’ index.php.

Has anyone had success getting Parcel working with a local WordPress installation, and if so, how would it be done? If not, do you use any other build tools as part of your development workflow, and why/why not?

2 Answers
2

Parcel is intended to be used to build apps from the ground up. That’s why they recommend starting with a index.js or index.html file.

You might be able to use Parcel’s packaging for a theme or plugin, but you would lose the built-in server and live reloading (“hot module replacement”) among other things. There may be more that wouldn’t work.

I don’t think Parcel is a good fit for WordPress development. Read more.

Leave a Comment