diff --git a/packages/vite-plugin-beasties/src/index.ts b/packages/vite-plugin-beasties/src/index.ts index ad5ae9b..6eb20c6 100644 --- a/packages/vite-plugin-beasties/src/index.ts +++ b/packages/vite-plugin-beasties/src/index.ts @@ -83,10 +83,10 @@ export function beasties(options: ViteBeastiesOptions = {}): Plugin { } const originalCheckInline = beastiesInstance.checkInlineThreshold.bind(beastiesInstance) - beastiesInstance.checkInlineThreshold = function checkInlineThreshold(style, before, sheetInverse) { - const isStyleInlined = originalCheckInline(style, before, sheetInverse) + beastiesInstance.checkInlineThreshold = function checkInlineThreshold(link, style, sheet) { + const isStyleInlined = originalCheckInline(link, style, sheet) - if (isStyleInlined || !sheetInverse.length) { + if (isStyleInlined || !sheet.length) { // @ts-expect-error internal property const name = style.$$name.replace(LEADING_SLASH_RE, '') as string if (name in bundle && bundle[name]!.type === 'asset') { diff --git a/packages/vite-plugin-beasties/test/index.test.ts b/packages/vite-plugin-beasties/test/index.test.ts index 82f77d2..86c7c3d 100644 --- a/packages/vite-plugin-beasties/test/index.test.ts +++ b/packages/vite-plugin-beasties/test/index.test.ts @@ -100,6 +100,27 @@ describe('vite-plugin-beasties', () => { expect(otherHtml).not.toContain('