diff options
author | 2023-06-10 13:43:26 -0400 | |
---|---|---|
committer | 2023-06-10 13:43:26 -0400 | |
commit | a30f2f3de440c39c88a4e0ed3f47064a6b5a54f7 (patch) | |
tree | 32ea351ef5ce789d423226fbe703cf3a46efc260 /packages/integrations/markdoc/src/utils.ts | |
parent | 491c2db424434167327e780ad57b8f665498003d (diff) | |
download | astro-a30f2f3de440c39c88a4e0ed3f47064a6b5a54f7.tar.gz astro-a30f2f3de440c39c88a4e0ed3f47064a6b5a54f7.tar.zst astro-a30f2f3de440c39c88a4e0ed3f47064a6b5a54f7.zip |
Fix Markdoc cloudflare errors (#7351)
* fix: move `node:` libs out of utils
* fix: node -> default
* chore: remove kleur from markdoc ex (why was this there??)
* chore: lock
* chore: changeset
Diffstat (limited to 'packages/integrations/markdoc/src/utils.ts')
-rw-r--r-- | packages/integrations/markdoc/src/utils.ts | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/packages/integrations/markdoc/src/utils.ts b/packages/integrations/markdoc/src/utils.ts index 1daf8f026..8dd4075db 100644 --- a/packages/integrations/markdoc/src/utils.ts +++ b/packages/integrations/markdoc/src/utils.ts @@ -1,6 +1,4 @@ import matter from 'gray-matter'; -import crypto from 'node:crypto'; -import path from 'node:path'; import type { ErrorPayload as ViteErrorPayload } from 'vite'; /** @@ -112,18 +110,3 @@ export function hasContentFlag(viteId: string, flag: string): boolean { const flags = new URLSearchParams(viteId.split('?')[1] ?? ''); return flags.has(flag); } - -/** - * Create build hash for manual Rollup chunks. - * @see 'packages/astro/src/core/build/plugins/plugin-css.ts' - */ -export function createNameHash(baseId: string, hashIds: string[]): string { - const baseName = baseId ? path.parse(baseId).name : 'index'; - const hash = crypto.createHash('sha256'); - for (const id of hashIds) { - hash.update(id, 'utf-8'); - } - const h = hash.digest('hex').slice(0, 8); - const proposedName = baseName + '.' + h; - return proposedName; -} |