How to copy dir?
Thank you for the question.
Directories which have some content files will be copied automatically.
If you want to copy empty directories, use --include-empty-dirs option.
cpx src dist doesn't work?
Currently, no. I have designed this tool to copy specific files as companion to transpilers. I had not thought copying directories. The feature would be useful.
No problem. For anyone else stumbling upon this in the interim (or if you want to borrow some code) https://www.npmjs.com/package/ncp can do this.
Thanks for your work @mysticatea
i have an idea !
cpx "favicons/**/*.*" ./dest
target
android-chrome-144x144.png android-chrome-192x192.png android-chrome-36x36.png android-chrome-48x48.png android-chrome-72x72.png android-chrome-96x96.png apple-touch-icon-114x114-precomposed.png apple-touch-icon-114x114.png apple-touch-icon-120x120-precomposed.png apple-touch-icon-120x120.png apple-touch-icon-144x144-precomposed.png apple-touch-icon-144x144.png apple-touch-icon-152x152-precomposed.png apple-touch-icon-152x152.png apple-touch-icon-180x180-precomposed.png apple-touch-icon-180x180.png apple-touch-icon-57x57-precomposed.png apple-touch-icon-57x57.png apple-touch-icon-60x60-precomposed.png apple-touch-icon-60x60.png apple-touch-icon-72x72-precomposed.png apple-touch-icon-72x72.png apple-touch-icon-76x76-precomposed.png apple-touch-icon-76x76.png apple-touch-icon-precomposed.png apple-touch-icon.png browserconfig.xml favicon-160x160.png favicon-16x16.png favicon-196x196.png favicon-32x32.png favicon-48x48.png favicon-96x96.png favicon.ico manifest.json mstile-144x144.png mstile-150x150.png mstile-310x150.png mstile-310x310.png mstile-70x70.png
however, this is not perfect... its without filename extension
ex) readme
this works fine for me, without configuring file extensions. packages folder has 4-5 more folders, with different files in them. not sure if this was the exact question.
"scripts": {
"start": "yarn watchChanges",
"watchChanges": "cpx \"packages/**\" \"web/src\" --watch & cpx \"packages/**\" \"mobile/src\" --watch"
}
following works for me:
cpx "icons/**" build/icons && ..
I need this and I also think adding this feature would be great.
P.S. for future readers: I achieved it like this (notice how the assets directory has been copied):
"scripts": {
"dev": "concurrently \"npx cpx src/static/**/* dist --watch\" \"npx cpx manifest.json dist --watch\" \"npx cpx assets/**/* dist/assets\" \"npx tsc --watch\""
},