rollup-plugin-strip-final-exports
v1.0.0
Published
Rollup plugin to strip the exports left in the output files
Downloads
3
Maintainers
Readme
Rollup plugin remove final exports
Description
This is a plugin intended to strip the final exports that rollup leave in the bundle file.
Usage
This plugin is pretty straight forward. Simply add it to your plugins array and it'll do what is intended to.
// rollup.config.js
import stripFinalExports from 'rollup-plugin-strip-final-exports';
export default {
input: 'src/index.js',
output: 'dist/index.js',
plugins: [
stripFinalExports(),
]
}
By using this plugin, he following lines will be removed from your output file
CommonJS modules
exports.foo = foo;
module.exports = foo;
module.exports.foo = foo;
module['exports'] = foo;
module['exports'].foo = foo;
module.exports['foo'] = foo;
ES modules
export const foo = 'Foo';
export { foo };
export default foo;
export default 'Foo';
export { foo } from './foo';
export * from './foo';
export default from 'foo';