diff --git a/src/plugin/typescript-plugin.ts b/src/plugin/typescript-plugin.ts index a833f3a4..fb594c3a 100644 --- a/src/plugin/typescript-plugin.ts +++ b/src/plugin/typescript-plugin.ts @@ -330,6 +330,8 @@ export default function typescriptRollupPlugin(pluginInputOptions: Partial { const localModuleNames = Object.keys(chunk.modules).filter(canEmitForFile); const entryFileName = localModuleNames.slice(-1)[0]; + // Don't emit declarations when there is no compatible entry file + if (entryFileName == null) return; emitDeclarations({ chunk,