rollup-plugin-remap
Plugin to imported modules to other file paths. Useful for conditional
compilation, ie: remapping development focused modules to a noop
during a prod
build.
Examples
In this example, we're remapping a logger module to a noop module during a production build of a project.
rollup.config.js
const plugins = ; if processenvBUILD_MODE === 'proudction' plugins; entry: 'src/someModule.js' plugins
Would remap the following import to a file called src/noop.js
.
src/someModule.js
; { // ... // do some stuff // ... ;}