rollup-plugin-cleanup
rollup-plugin-cleanup copied to clipboard
Fix options.extensions being modified by the plugin
Hi,
Your plugin modifies the extensions object passed to its options, which means it cannot be reused across plugins. This means the following sample config fails to properly resolve imports:
const cleanup = require('rollup-plugin-cleanup')
const resolve = require('@rollup/plugin-node-resolve').default
const extensions = ['.js', '.jsx', '.ts', '.tsx', '.json', '.md', '.mdx']
module.exports = {
// ...
plugins: [
resolve({ extensions }),
cleanup({ extensions }),
],
}
The following PR will ensure extensions are copied instead of written over. It allows Rollup users to share an extension list across plugins.
I don't know what's up with the build bot. The yarn build and yarn test commands both succeed locally.