-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to Next.js v14.2.3 and fix latest o1js usage issue. (#652)
Co-authored-by: Yoni Mekuria <[email protected]>
- Loading branch information
Showing
6 changed files
with
84 additions
and
82 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
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
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 |
---|---|---|
@@ -1,26 +1,25 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
import { readdirSync, readFileSync, writeFileSync } from 'fs'; | ||
import { dirname, extname, join } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
// This script modifies the built CSS files and prepends the repo-name to the asset URLs. | ||
// to be compatible with github pages deployment. | ||
const cssDir = path.join(__dirname, '/out/_next/static/css'); | ||
// This script modifies the built CSS files and prepends the repo-name to the asset URLs | ||
// to be compatible with the GitHub pages deployments. | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = dirname(__filename); | ||
const cssDir = join(__dirname, '/out/_next/static/css'); | ||
|
||
// Update your repository name here if it is different from the project name. | ||
let repoURL = ''; | ||
const files = fs.readdirSync(cssDir); | ||
const files = readdirSync(cssDir); | ||
|
||
files.forEach((file) => { | ||
if (path.extname(file) === '.css') { | ||
const filePath = path.join(cssDir, file); | ||
|
||
const data = fs.readFileSync(filePath, 'utf8'); | ||
|
||
if (extname(file) === '.css') { | ||
const filePath = join(cssDir, file); | ||
const data = readFileSync(filePath, 'utf8'); | ||
const singleQuoteRegex = new RegExp(`url\\(\\s*'\\/(?!${repoURL})`, 'g'); | ||
const doubleQuoteRegex = new RegExp(`url\\(\\s*"\\/(?!${repoURL})`, 'g'); | ||
|
||
let result = data.replace(singleQuoteRegex, `url('/${repoURL}/`); | ||
result = result.replace(doubleQuoteRegex, `url("/${repoURL}/`); | ||
|
||
fs.writeFileSync(filePath, result, 'utf8'); | ||
writeFileSync(filePath, result, 'utf8'); | ||
} | ||
}); |
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