A Rollup plugin for creating virtual modules that behave like real files, useful for testing or generating modules on-the-fly. Version 0.0.1 is the initial unstable release. Different from @rollup/plugin-virtual in that ephemeral modules are treated as real file modules by Rollup, affecting resolution and caching behavior. This package ships TypeScript types and supports ESM only.
npm install rollup-plugin-ephemeralVerified import paths — ran on the pinned version, not inferred.
Shows basic usage: create a virtual module entry.js that exports a constant, then bundle with Rollup and output the generated code.
Use import syntax and ensure your project is configured for ESM (e.g., type: module in package.json).
If you need standard virtual module behavior, use @rollup/plugin-virtual instead.
Call ephemeral('id', 'code') with exactly two string arguments.Switch to dynamic import: const ephemeral = await import('rollup-plugin-ephemeral'); or configure your project as ESM.Use: import ephemeral from 'rollup-plugin-ephemeral'; Do not use named import: import { ephemeral } from 'rollup-plugin-ephemeral';No dependency data recorded yet.