Last active
January 9, 2021 21:54
-
-
Save MaikelVeen/036dd86b2f71678151321f4ff483ab79 to your computer and use it in GitHub Desktop.
Reading the manifest file.
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
const ReadManifestFile = (basePath: string): object => { | |
const routes_manifest_path = path.join(basePath + '/.next/server/pages-manifest.json'); | |
// Read from the file | |
if (fs.existsSync(routes_manifest_path)) { | |
const raw_json = fs.readFileSync(routes_manifest_path); | |
return JSON.parse(raw_json.toString()); | |
} else return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment