From 837d43228effb52814b12cfcf19cb8e2a43c35dc Mon Sep 17 00:00:00 2001 From: greymoth-jp <246701683+greymoth-jp@users.noreply.github.com> Date: Mon, 29 Jun 2026 04:10:00 +0000 Subject: [PATCH] fix(esm-shim): match typings to actual exports --- packages/esm-shim/test/types.ts | 4 ++-- packages/esm-shim/types/index.d.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/esm-shim/test/types.ts b/packages/esm-shim/test/types.ts index fc244a850..43e3a54cc 100644 --- a/packages/esm-shim/test/types.ts +++ b/packages/esm-shim/test/types.ts @@ -1,6 +1,6 @@ import type { RollupOptions } from 'rollup'; -import commonjsShim from '../types/index'; +import esmShimDefault, { esmShim } from '../types/index'; const config: RollupOptions = { input: 'main.js', @@ -8,7 +8,7 @@ const config: RollupOptions = { file: 'bundle.js', format: 'iife' }, - plugins: [commonjsShim()] + plugins: [esmShimDefault(), esmShim()] }; export default config; diff --git a/packages/esm-shim/types/index.d.ts b/packages/esm-shim/types/index.d.ts index e7a2df455..6f279ece7 100644 --- a/packages/esm-shim/types/index.d.ts +++ b/packages/esm-shim/types/index.d.ts @@ -1,6 +1,6 @@ import type { Plugin, SourceMapInput } from 'rollup'; -interface Output { +export interface Output { code: string; map?: SourceMapInput; } @@ -10,5 +10,6 @@ interface Output { * * @returns Plugin instance. */ -export default function commonjsShim(): Plugin; +export function esmShim(): Plugin; +export default esmShim; export function provideCJSSyntax(code: string): Output | null;