Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

fix: esbuild plugin converter with empty JS files.#516

Merged
sapphi-red merged 1 commit intovitejs:rolldown-vitefrom
cpojer:fix-plugin-converter
Nov 20, 2025
Merged

fix: esbuild plugin converter with empty JS files.#516
sapphi-red merged 1 commit intovitejs:rolldown-vitefrom
cpojer:fix-plugin-converter

Conversation

@cpojer
Copy link
Copy Markdown

@cpojer cpojer commented Nov 20, 2025

When converting an esbuild plugin to a rolldown plugin, we check if the result of the plugin call is "empty". However, if a file is empty, it will throw a not implemented error even if there is nothing wrong with the plugin.

This fixes it to check whether the value is nullable, not if it is an empty string. As a result, rolldown-vite no longer throws during the dependency optimization step.

I tested this by applying this patch to an internal codebase and it no longer throws at this step. The file in question that is being loaded is a random transitive dependency that's empty. Please don't ask me why that's a thing: https://unpkg.com/@standard-schema/spec@1.0.0/dist/index.js

@cpojer cpojer changed the title Fix plugin converter. [rolldown-vite] Fix esbuild plugin converter. Nov 20, 2025
@cpojer cpojer changed the title [rolldown-vite] Fix esbuild plugin converter. [rolldown-vite] Fix esbuild plugin converter with empty JS files. Nov 20, 2025
@cpojer cpojer changed the base branch from main to rolldown-vite November 20, 2025 05:04
@cpojer cpojer changed the title [rolldown-vite] Fix esbuild plugin converter with empty JS files. [rolldown-vite] fix: esbuild plugin converter with empty JS files. Nov 20, 2025
@cpojer cpojer changed the title [rolldown-vite] fix: esbuild plugin converter with empty JS files. fix: esbuild plugin converter with empty JS files. Nov 20, 2025
Copy link
Copy Markdown
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, makes sense to me

@sapphi-red sapphi-red enabled auto-merge (squash) November 20, 2025 05:49
@sapphi-red sapphi-red merged commit 54cfc00 into vitejs:rolldown-vite Nov 20, 2025
14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants