From f7272e09f866bf02372597a151c1b2f686f2cd5b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 10 Aug 2022 16:09:14 +0200 Subject: [PATCH] fix(rollup): normalize stub entry path --- src/builder/rollup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builder/rollup.ts b/src/builder/rollup.ts index 6b8723f..ca13d65 100644 --- a/src/builder/rollup.ts +++ b/src/builder/rollup.ts @@ -9,7 +9,7 @@ import alias from '@rollup/plugin-alias' import _esbuild from 'rollup-plugin-esbuild' import dts from 'rollup-plugin-dts' import replace from '@rollup/plugin-replace' -import { relative, resolve, dirname } from 'pathe' +import { relative, resolve, dirname, normalize } from 'pathe' import { resolvePath, resolveModuleExportNames } from 'mlly' import { getpkg, tryResolve, warn } from '../utils' import type { BuildContext } from '../types' @@ -30,7 +30,7 @@ export async function rollupBuild (ctx: BuildContext) { for (const entry of ctx.options.entries.filter(entry => entry.builder === 'rollup')) { const output = resolve(ctx.options.rootDir, ctx.options.outDir, entry.name!) - const resolvedEntry = tryResolve(entry.input, ctx.options.rootDir) || entry.input + const resolvedEntry = normalize(tryResolve(entry.input, ctx.options.rootDir) || entry.input) const code = await fsp.readFile(resolvedEntry, 'utf8') const shebang = getShebang(code)