Skip to content

Latest commit

 

History

History

rollup-plugin-replace-imports

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

rollup-plugin-replace-imports

npm package

Replace unresolved imports.

NPM version NPM Downloads

使用

import replaceImports from 'rollup-plugin-replace-imports';

export default {
  input: 'src/index.js',
  plugins: [
    // ...
  ],
  output: [
    {
      dir: 'dist',
      format: 'cjs',
      exports: 'auto',
      plugins: [
        replaceImports(n => n.replace('/es/', '/')),
      ],
    },
    {
      dir: 'dist/es',
      format: 'es',
      exports: 'auto',
    },
  ],
};