| | |
| | | import { FilePath, joinSegments, slugifyFilePath } from "../../path" |
| | | import { FilePath, joinSegments, slugifyFilePath } from "../../util/path" |
| | | import { QuartzEmitterPlugin } from "../types" |
| | | import path from "path" |
| | | import fs from "fs" |
| | | import { glob } from "../../glob" |
| | | import { glob } from "../../util/glob" |
| | | |
| | | export const Assets: QuartzEmitterPlugin = () => { |
| | | return { |
| | |
| | | const dir = path.dirname(dest) as FilePath |
| | | await fs.promises.mkdir(dir, { recursive: true }) // ensure dir exists |
| | | await fs.promises.copyFile(src, dest) |
| | | res.push(fp) |
| | | res.push(dest) |
| | | } |
| | | |
| | | return res |