rolldown_plugin_load_fallback

Crates.iorolldown_plugin_load_fallback
lib.rsrolldown_plugin_load_fallback
version0.1.0
created_at2025-10-18 03:36:25.893328+00
updated_at2025-10-18 03:36:25.893328+00
descriptionRolldown plugin for load fallback handling
homepagehttps://rolldown.rs/
repositoryhttps://github.com/rolldown/rolldown
max_upload_size
id1888766
size81,363
Boshen (Boshen)

documentation

README

Maintenance Guide

A plugin for rolldown-vite that handles loading files with query or hash fragments, ported from Vite's loadFallbackPlugin.

This plugin is exclusive to rolldown-vite and is not recommended for external use.

📦 What it does

This plugin provides a fallback mechanism for module IDs with query (?) or hash (#) fragments. It strips the query/hash, loads the file from the filesystem, and adds the stripped path to the watch list for hot reloading.

🚀 Debug Usage

import { defineConfig } from 'rolldown';
import { loadFallbackPlugin } from 'rolldown/experimental';

export default defineConfig({
  input: {
    entry: './main.ts',
  },
  plugins: [loadFallbackPlugin()],
});

🧪 Porting Differences

In Vite’s plugin, if reading the cleaned path fails, it falls back to reading the original full ID (including the query/hash).

In contrast, Rolldown’s plugin only attempts to read the cleaned path and does not retry the full ID, leaving such cases to be handled by the rolldown core loading logic.

Commit count: 6097

cargo fmt