Skip to main content
2 of 2
edited tags
fuxia
  • 107.1k
  • 38
  • 255
  • 459

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

When using @wordpress/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?

Thanks.

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

Greeso
  • 2.2k
  • 7
  • 32
  • 56