Closed michaelsoriano closed 5 years ago
There's currently no way to do that from create-react-wptheme
so you'd have to do it manually.
Or think about creating your own Node script to copy the build folder, then read styles.css from the copy and then modify the name, and finally re-write the file is pretty simple.
I've used shelljs
for similar tasks before, check it out:
In fact that example copies a build folder and uses sed
to modify the JS files in there. Sounds pretty close to what you're looking for.
This is awesome. Thanks again!
Hi @devloco - a few more questions if you don't mind.
When I do npm run wpbuild, can I have the "build" folder outside of the theme directory (as another theme - with a different name)?
So it will have a my-theme-prod instead of my-theme in styles.css?
The reason is, I would like to check 2 versions in my Git repo - so our deployment scripts can simply grab the my-theme-prod and install it.
Thanks in advance.