UNPKG

@aziontech/opennextjs-azion

Version:
19 lines (18 loc) 660 B
/** * This code was originally copied and modified from the @opennextjs/cloudflare repository. * Significant changes have been made to adapt it for use with Azion. */ import { cpSync, existsSync, rmSync } from "node:fs"; import path from "node:path"; import logger from "@opennextjs/aws/logger.js"; export function copyAssets(target, destination) { logger.info("Populating assets..."); const targetDir = path.join(target); if (existsSync(destination)) { rmSync(destination, { recursive: true, force: true }); } cpSync(targetDir, destination, { recursive: true, }); logger.info(`Successfully populated assets`); }