Skip to content

Commit

Permalink
Revert 9186986
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGiorgio committed Nov 5, 2023
1 parent 388596e commit 82f4a3d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 52 deletions.
51 changes: 0 additions & 51 deletions index.html

This file was deleted.

17 changes: 17 additions & 0 deletions insertHead.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "solid-start dev",
"host": "solid-start dev --host",
"build": "solid-start build",
"build": "solid-start build && node insertHead.js",
"start": "solid-start start",
"check-types": "tsc --noemit",
"eslint": "eslint src",
Expand Down

0 comments on commit 82f4a3d

Please sign in to comment.