| Crates.io | rolldown_plugin_load_fallback |
| lib.rs | rolldown_plugin_load_fallback |
| version | 0.1.0 |
| created_at | 2025-10-18 03:36:25.893328+00 |
| updated_at | 2025-10-18 03:36:25.893328+00 |
| description | Rolldown plugin for load fallback handling |
| homepage | https://rolldown.rs/ |
| repository | https://github.com/rolldown/rolldown |
| max_upload_size | |
| id | 1888766 |
| size | 81,363 |
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.
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.
import { defineConfig } from 'rolldown';
import { loadFallbackPlugin } from 'rolldown/experimental';
export default defineConfig({
input: {
entry: './main.ts',
},
plugins: [loadFallbackPlugin()],
});
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.