mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-17 14:24:26 +01:00
18 lines
468 B
JavaScript
18 lines
468 B
JavaScript
import { readFile, writeFile } from 'fs/promises';
|
|
import { join } from 'path';
|
|
|
|
const insertHeadTag = async () => {
|
|
const filePath = join(process.cwd(), 'dist', 'public', 'index.html');
|
|
try {
|
|
let data = await readFile(filePath, 'utf8');
|
|
const lines = data.split('\n');
|
|
lines.splice(2, 0, '<head></head>');
|
|
data = lines.join('\n');
|
|
await writeFile(filePath, data);
|
|
} catch (err) {
|
|
console.error(`Error: ${err}`);
|
|
}
|
|
};
|
|
|
|
insertHeadTag();
|