We have within a package.json build script a copy command (no we cant quickly change that).
Is there any solution we can make this work multiplatform with the same syntax easily?
I looked in several npm copy packages, but they don't transpile from windows to unix paths.
We basically need something like:
"build": "doStuff && cp -r ../folder/ /dist/"
working for windows.
Any ideas?
For a cross-platform solution consider utilizing the shx package.
Firstly cd
to your project directory and run the following command to install it:
npm i -D shx
Then redefine your build
script in the scripts
section of your package.json as follows:
"scripts": {
"build": "doStuff && shx cp -r ../folder/ ./dist/"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With