rollup-plugin-virtual-alias
Alias dependencies using virtual modules.
Usage
Suppose you are working with an existing codebase and want to substitute one
API compatible dependency for another. In my case, I wanted to try
preact-compat
in place of react
.
// src.main.js;;
// rollup.config.js; entry: 'src/main.js' // ... plugins: ;
As with rollup-plugin-virtual
, use this plugin before other plugins like
rollup-plugin-node-resolve
or rollup-plugin-commonjs
.
Implementation
This package translates each pair in the mapping passed to virtual_alias()
into a module string for rollup-plugin-virtual
. So the following:
; // ... // ...
Is equivalent to:
; // ... // ...…
License
This package was inspired and heavily derived from Rich-Harris's work in
rollup/rollup-plugin-virtual
.