Skip to content

Commit 8fec5aa

Browse files
committed
Add header and footer to built file
Added brief attribution/copyright notice and a `sourceURL` to help debugging in production.
1 parent 73d2a9f commit 8fec5aa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/build.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if (!result.code) throw new Error('Minify failed for obs.js');
2222

2323

2424
// Leading ';' to guard against ASI, tiny banner for provenance
25-
const banner = '/*! Obs.js | MIT */\n;';
26-
await writeFile(OUTPUT, banner + result.code, 'utf8');
25+
const header = '/*! Obs.js | (c) Harry Roberts, csswizardry.com | MIT */\n;';
26+
const footer = '\n//# sourceURL=obs.inline.js';
27+
await writeFile(OUTPUT, header + result.code + footer, 'utf8');
2728
console.log(`[obs] Wrote ${OUTPUT}`);

0 commit comments

Comments
 (0)