feat(templates): add with-vercel-website (#9144)

Add new `with-vercel-website` that uses the website template as a base.
This commit is contained in:
Elliot DeNolf
2024-11-12 13:12:37 -05:00
committed by GitHub
parent 8dd7e989ef
commit def595e645
194 changed files with 24100 additions and 4091 deletions

View File

@@ -6,13 +6,16 @@ import path from 'path'
*
* @internal
*/
export function copyRecursiveSync(src: string, dest: string) {
export function copyRecursiveSync(src: string, dest: string, ignoreRegex?: string[]): void {
const exists = fs.existsSync(src)
const stats = exists && fs.statSync(src)
const isDirectory = exists && stats !== false && stats.isDirectory()
if (isDirectory) {
fs.mkdirSync(dest, { recursive: true })
fs.readdirSync(src).forEach((childItemName) => {
if (ignoreRegex && ignoreRegex.some((regex) => new RegExp(regex).test(childItemName))) {
return
}
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName))
})
} else {