Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix options.extensions being modified by the plugin #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sidnioulz
Copy link

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.

@Sidnioulz
Copy link
Author

I don't know what's up with the build bot. The yarn build and yarn test commands both succeed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant