From 136c34fd0598b7b9a0aa04303a473f4fe6d41de7 Mon Sep 17 00:00:00 2001 From: Thomas Stachl <286093+tstachl@users.noreply.github.com> Date: Sun, 5 Jan 2025 16:48:19 -0800 Subject: [PATCH] removing unnecessary v8 dependency (#834) * removing unnecessary v8 dependency * Create kind-stingrays-sniff.md --------- Co-authored-by: Jack Steam --- .changeset/kind-stingrays-sniff.md | 5 +++++ packages/vite-plugin/src/node/helpers.ts | 5 ----- packages/vite-plugin/src/node/plugin-manifest.ts | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 .changeset/kind-stingrays-sniff.md diff --git a/.changeset/kind-stingrays-sniff.md b/.changeset/kind-stingrays-sniff.md new file mode 100644 index 000000000..b33899f98 --- /dev/null +++ b/.changeset/kind-stingrays-sniff.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +removing unnecessary v8 dependency diff --git a/packages/vite-plugin/src/node/helpers.ts b/packages/vite-plugin/src/node/helpers.ts index 9a953e294..1d086c6a5 100644 --- a/packages/vite-plugin/src/node/helpers.ts +++ b/packages/vite-plugin/src/node/helpers.ts @@ -2,7 +2,6 @@ import { simple } from 'acorn-walk' import { createHash as _hash } from 'crypto' import debug from 'debug' import { AcornNode, OutputBundle, PluginContext } from 'rollup' -import v8 from 'v8' import type { ManifestV3, WebAccessibleResourceById, @@ -17,10 +16,6 @@ import type { export const _debug = (id: string) => debug('crx').extend(id) -export const structuredClone = (obj: T): T => { - return v8.deserialize(v8.serialize(obj)) -} - export const hash = (data: string, length = 5): string => _hash('sha1') .update(data) diff --git a/packages/vite-plugin/src/node/plugin-manifest.ts b/packages/vite-plugin/src/node/plugin-manifest.ts index d6c838bf0..6313cc1bb 100644 --- a/packages/vite-plugin/src/node/plugin-manifest.ts +++ b/packages/vite-plugin/src/node/plugin-manifest.ts @@ -11,7 +11,6 @@ import { decodeManifest, encodeManifest, isString, - structuredClone, } from './helpers' import { ManifestV3 } from './manifest' import { basename, isAbsolute, join, relative } from './path'