18 lines
583 B
JavaScript
18 lines
583 B
JavaScript
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
import { dirname, resolve } from 'node:path';
|
|
|
|
const root = resolve(import.meta.dirname, '..');
|
|
const sourcePath = resolve(root, 'src/hdr-enhance.js');
|
|
const outputPath = resolve(root, 'dist/hdr-web-plugin.js');
|
|
const source = await readFile(sourcePath, 'utf8');
|
|
const banner = [
|
|
'/*!',
|
|
' * HDR Web Plugin v0.6.2',
|
|
' * Drop-in pure-black HDR media stage for web pages.',
|
|
' */',
|
|
''
|
|
].join('\n');
|
|
|
|
await mkdir(dirname(outputPath), { recursive: true });
|
|
await writeFile(outputPath, `${banner}${source}`, 'utf8');
|