Renaming the ‘build’ directory generated by @wordpress/scripts for React development


When using wordpress user/scripts" rel="nofollow noreferrer">wordpress user/scripts to create a React app for WordPress, the default configuration to build the app is via running one of the following two scripts wp-scripts build or wp-scripts start (both run from within package.json). Both scripts will take the code from the src directory and build it into the build directory.

I would like to change the destination directory; for example, I would like the result to be in dist/app instead of build. I found an option to change the source directory; the option is --webpack-src-dir (I have not used it, but I think with a little bit of tinkering, I will find out how), however I could not find a way of changing the destination directory. Is this possible?


PS: This is the first time using React with WordPress, so apologies about the simple question.

Greeso 3 weeks 2023-01-16T18:53:50-05:00 0 Answers 0 views 0

Leave an answer