Registry / devops / rollup-plugin-auto-named-exports

rollup-plugin-auto-named-exports

JSON →
library1.0.0-beta.3jsnpmunverified

A Rollup plugin that automatically resolves named exports from CommonJS modules to avoid the 'is not exported by module' error. Version 1.0.0-beta.3. Base on rollup-plugin-commonjs, it scans modules and generates namedExports configuration automatically. Release cadence: low, beta stage. Key differentiator: eliminates manual namedExports configuration in rollup-plugin-commonjs. Alternative to manual namedExports or @rollup/plugin-commonjs namedExports. Note: tree-shaking may be affected, use with caution for production builds.

npm install rollup-plugin-auto-named-exports
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-AUTO
R
rollup-plugin-auto-named-exports
devopsjavascriptv1.0.0-beta.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

autoNamedExports
import autoNamedExports from 'rollup-plugin-auto-named-exports'
const { autoNamedExports } = require('rollup-plugin-auto-named-exports')
Package exports a default function. CommonJS require works as it's CJS-compatible, but destructuring { autoNamedExports } is wrong because it's not a named export.
default
const autoNamedExports = require('rollup-plugin-auto-named-exports')
const { default: autoNamedExports } = require('rollup-plugin-auto-named-exports')
For TypeScript with esModuleInterop, default import is preferred. With require, use plain require.
Plugin types
import type { Plugin } from 'rollup'
The plugin types are inferred from Rollup; no explicit type export from this package.

Basic setup with rollup-plugin-node-resolve, rollup-plugin-commonjs, and auto-named-exports to automatically resolve named exports.

import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import autoNamedExports from 'rollup-plugin-auto-named-exports'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'cjs' }, plugins: [ resolve(), commonjs({ namedExports: { // no need manual custom } }), autoNamedExports() ] };
Debug
Known issues
breakingTree-shaking may not work correctly
fix
Use manual namedExports if tree-shaking is critical; avoid this plugin in production builds where bundle size matters.
affects: >=0.0.0
deprecatedPackage is based on old rollup-plugin-commonjs, not @rollup/plugin-commonjs
fix
Migrate to @rollup/plugin-commonjs and consider using its namedExports or other solutions.
affects: >=0.0.0
gotchaPotential performance impact on build time
fix
Use only when necessary; for large projects, specifcy namedExports manually.
affects: >=0.0.0
gotchaBeta version, may have bugs
fix
Test thoroughly in your environment, consider alternatives for production.
affects: 1.0.0-beta.3
Errors
Common errors & fixes
Error: "[name] is not exported by [module]"
CommonJS module does not have named exports that Rollup can statically analyze
fix
Add rollup-plugin-auto-named-exports to automatically resolve named exports.
TypeError: Cannot read properties of undefined (reading 'namedExports')
rollup-plugin-commonjs not included or configured before autoNamedExports()
fix
Ensure commonjs() plugin is added to plugins array before autoNamedExports() as shown in quickstart.
The plugin "auto-named-exports" does not support Rollup v3+
Plugin is not compatible with newer Rollup versions (v3+)
fix
Use alternative solutions like @rollup/plugin-commonjs with namedExports manually or upgrade the plugin if a newer version exists.
Upgrade
Version history
1.0.0-beta.3latest on npm
Audit
Dependencies
rollup-plugin-commonjsrequiredpeer dependency; plugin works as an add-on to rollup-plugin-commonjs
rolluprequiredpeer dependency; requires Rollup to function
Agent activity
10 hits · last 30 days
node
8
Resources
rollup-plugin-auto-named-exports — npm install rollup-plugin-auto-named-exports · libregistry