-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor/Made script which fix url in dist/index.html
- Loading branch information
Andreas Kluge Svendsrud
authored and
Andreas Kluge Svendsrud
committed
Sep 11, 2024
1 parent
b759b46
commit 29a6e56
Showing
4 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { readFile, writeFile } from 'fs/promises'; | ||
import path from 'path'; | ||
|
||
const filePath = path.join(process.cwd(), 'dist/index.html'); | ||
|
||
try { | ||
const data = await readFile(filePath, 'utf8'); | ||
|
||
const result = data.replace(/\/assets\//g, './assets/'); | ||
|
||
await writeFile(filePath, result, 'utf8'); | ||
console.log('Successfully updated index.html paths!'); | ||
} catch (err) { | ||
console.error('Error processing index.html:', err); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters