pdfkit
Version:
A JavaScript PDF generation library
18 lines (16 loc) • 376 B
JavaScript
import { readFile } from 'fs/promises';
/**
* Emits a source file as an asset at a fixed path in the Rollup output.
*/
export default function asset(sourcePath, outputPath) {
return {
name: 'asset',
async buildStart() {
this.emitFile({
type: 'asset',
fileName: outputPath,
source: await readFile(sourcePath),
});
},
};
}