-
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.
- Loading branch information
Prettier Bot
committed
Sep 11, 2024
1 parent
29a6e56
commit 50825da
Showing
2 changed files
with
9 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { readFile, writeFile } from 'fs/promises'; | ||
import path from 'path'; | ||
import { readFile, writeFile } from 'fs/promises' | ||
import path from 'path' | ||
|
||
const filePath = path.join(process.cwd(), 'dist/index.html'); | ||
const filePath = path.join(process.cwd(), 'dist/index.html') | ||
|
||
try { | ||
const data = await readFile(filePath, 'utf8'); | ||
const data = await readFile(filePath, 'utf8') | ||
|
||
const result = data.replace(/\/assets\//g, './assets/'); | ||
const result = data.replace(/\/assets\//g, './assets/') | ||
|
||
await writeFile(filePath, result, 'utf8'); | ||
console.log('Successfully updated index.html paths!'); | ||
await writeFile(filePath, result, 'utf8') | ||
console.log('Successfully updated index.html paths!') | ||
} catch (err) { | ||
console.error('Error processing index.html:', 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.