generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Testing PPR for docs landing page * chore: Remove PPR * chore: Dump bundle size in a file * chore: Try fixing demo path again * chore: Only send ISR invalidation once * chore: Unsuspend GHA status
- Loading branch information
Showing
9 changed files
with
83 additions
and
167 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
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,11 +1,15 @@ | ||
import { execa } from 'execa' | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import prettyBytes from 'pretty-bytes' | ||
|
||
export async function BundleSize() { | ||
const { stdout } = await execa('./node_modules/.bin/size-limit', ['--json'], { | ||
cwd: path.resolve(process.cwd(), '../../packages/nuqs') | ||
}) | ||
const [{ size }] = JSON.parse(stdout) | ||
return prettyBytes(size) | ||
const filePath = path.resolve(process.cwd(), '../../packages/nuqs/size.json') | ||
try { | ||
const json = await fs.readFile(filePath, 'utf8') | ||
const [{ size }] = JSON.parse(json) | ||
return prettyBytes(size) | ||
} catch (error) { | ||
console.error(error) | ||
return 'less than 4KB' | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
size.json |
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
Oops, something went wrong.