Open banli17 opened 2 years ago
import { Plugin } from 'rollup' const virtualId = 'virtualId.js' export default function virtual(): Plugin { return { name: 'virtual', resolveId(source) { if (source === 'virtual') { return virtualId } }, load() { return 'export default "virtual"' }, generateBundle(options, bundle) { if (bundle[virtualId]) { delete bundle[virtualId] } }, } }