-
-
Notifications
You must be signed in to change notification settings - Fork 604
Closed
Description
- Rollup Plugin Name: all plugins except for node-resolve and babel
Feature Use Case
Using the default
export creates issues with CommonJS if we want to export more than one item. When using @rollup/plugin-babel
, the different import styles look like:
import babel from '@rollup/plugin-babel';
const babel = require('@rollup/plugin-babel').default;
In contrast, the named exports look more similar:
import { babel } from '@rollup/plugin-babel';
const { babel } = require('@rollup/plugin-babel');
Note: both formats work today because we export the plugin under babel
and default
.
Feature Proposal
As soon as we add any additional exports to a module, as was the case for @rollup/plugin-node-resolve
, we need to use named exports. I think we should switch to named exports for all plugins for consistency. We can continue to export default as well for the ES module import format, but CJS outputs would have breaking changes.
vladshcherbinTrySound and chicoxyzzy