diff --git a/src/builder/rollup.ts b/src/builder/rollup.ts index 51585ebf..ac6c5dc7 100644 --- a/src/builder/rollup.ts +++ b/src/builder/rollup.ts @@ -4,7 +4,7 @@ import { rollup } from 'rollup' import commonjs from '@rollup/plugin-commonjs' import { nodeResolve } from '@rollup/plugin-node-resolve' import alias from '@rollup/plugin-alias' -import esbuild from 'rollup-plugin-esbuild' +import _esbuild from 'rollup-plugin-esbuild' import dts from 'rollup-plugin-dts' import { relative, resolve } from 'pathe' import consola from 'consola' @@ -14,6 +14,9 @@ import { JSONPlugin } from './plugins/json' import { rawPlugin } from './plugins/raw' import { cjsPlugin } from './plugins/cjs' +// @ts-ignore https://github.com/unjs/unbuild/issues/23 +const esbuild = _esbuild.default || _esbuild + export async function rollupBuild (ctx: BuildContext) { if (ctx.stub) { for (const entry of ctx.entries.filter(entry => entry.builder === 'rollup')) {