rollup-plugin-replace-imports
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

rollup-plugin-replace-imports

替换导入模块的路径

使用

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',
    },
  ],
};

Package Sidebar

Install

npm i rollup-plugin-replace-imports

Weekly Downloads

327

Version

1.0.0

License

MIT

Unpacked Size

2.44 kB

Total Files

4

Last publish

Collaborators

  • fengxinming