From c2bc7b169c1a5de97a4a5881d2b736f2c8c66b32 Mon Sep 17 00:00:00 2001 From: hemengke1997 <49073282+hemengke1997@users.noreply.github.com> Date: Thu, 9 Feb 2023 09:40:56 +0800 Subject: [PATCH] wip --- playground/spa/publicTypescript/manifest.json | 2 +- src/index.ts | 2 +- src/utils/build.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playground/spa/publicTypescript/manifest.json b/playground/spa/publicTypescript/manifest.json index 48cebe3..992a857 100644 --- a/playground/spa/publicTypescript/manifest.json +++ b/playground/spa/publicTypescript/manifest.json @@ -1,4 +1,4 @@ { "haha": "/haha.b0269334.js", "index": "/index.ea6f9390.js" -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 64907e4..c96c3f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -163,7 +163,7 @@ export function publicTypescript(options: VPPTPluginOptions = {}) { async buildStart() { if (opts.ssrBuild || config.build.ssr) return - if (!isEmptyObject(previousOpts) && eq(previousOpts, opts)) { + if (eq(previousOpts, opts)) { return } diff --git a/src/utils/build.ts b/src/utils/build.ts index 50840a5..d044dbb 100644 --- a/src/utils/build.ts +++ b/src/utils/build.ts @@ -12,7 +12,7 @@ import { getGlobalConfig } from './globalConfig' import { assert } from './assert' import { crlf } from '.' -export function getContentHash(chunk: string | Uint8Array | undefined, hash: VPPTPluginOptions['hash']) { +export function getContentHash(chunk: string | Uint8Array | undefined, hash?: VPPTPluginOptions['hash']) { if (!chunk) return '' const hashLen = typeof hash === 'number' ? hash : 8 return createHash('sha256').update(chunk).digest('hex').substring(0, hashLen)