How do you delete and add a folder in on npm run build command in package.json

I have a separate frontend and backend folder and I need to copy the react build folder to the backend for SSR, so I've tried this

"build": "rm -rf ../some/path && react-scripts build && cp -r build ../some/path",

I've got this code from the internet. Unfortunately it doesn't work maybe because this code is for MAC and I'm using windows. So how do you recreate this code for windows or maybe there's better one ?

thank you very much



Read more here: https://stackoverflow.com/questions/68478279/how-do-you-delete-and-add-a-folder-in-on-npm-run-build-command-in-package-json

Content Attribution

This content was originally published by Melly at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: