{"id":21920,"library":"rollup-plugin-auto-named-exports","title":"rollup-plugin-auto-named-exports","description":"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.","status":"maintenance","version":"1.0.0-beta.3","language":"javascript","source_language":"en","source_url":"https://github.com/umijs/rollup-plugin-auto-named-exports","tags":["javascript","typescript"],"install":[{"cmd":"npm install rollup-plugin-auto-named-exports","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-auto-named-exports","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-auto-named-exports","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin works as an add-on to rollup-plugin-commonjs","package":"rollup-plugin-commonjs","optional":false},{"reason":"peer dependency; requires Rollup to function","package":"rollup","optional":false}],"imports":[{"note":"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.","wrong":"const { autoNamedExports } = require('rollup-plugin-auto-named-exports')","symbol":"autoNamedExports","correct":"import autoNamedExports from 'rollup-plugin-auto-named-exports'"},{"note":"For TypeScript with esModuleInterop, default import is preferred. With require, use plain require.","wrong":"const { default: autoNamedExports } = require('rollup-plugin-auto-named-exports')","symbol":"default","correct":"const autoNamedExports = require('rollup-plugin-auto-named-exports')"},{"note":"The plugin types are inferred from Rollup; no explicit type export from this package.","wrong":"","symbol":"Plugin types","correct":"import type { Plugin } from 'rollup'"}],"quickstart":{"code":"import resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport autoNamedExports from 'rollup-plugin-auto-named-exports';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'cjs'\n  },\n  plugins: [\n    resolve(),\n    commonjs({\n      namedExports: {\n        // no need manual custom\n      }\n    }),\n    autoNamedExports()\n  ]\n};","lang":"javascript","description":"Basic setup with rollup-plugin-node-resolve, rollup-plugin-commonjs, and auto-named-exports to automatically resolve named exports."},"warnings":[{"fix":"Use manual namedExports if tree-shaking is critical; avoid this plugin in production builds where bundle size matters.","message":"Tree-shaking may not work correctly","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Migrate to @rollup/plugin-commonjs and consider using its namedExports or other solutions.","message":"Package is based on old rollup-plugin-commonjs, not @rollup/plugin-commonjs","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use only when necessary; for large projects, specifcy namedExports manually.","message":"Potential performance impact on build time","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test thoroughly in your environment, consider alternatives for production.","message":"Beta version, may have bugs","severity":"gotcha","affected_versions":"1.0.0-beta.3"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Add rollup-plugin-auto-named-exports to automatically resolve named exports.","cause":"CommonJS module does not have named exports that Rollup can statically analyze","error":"Error: \"[name] is not exported by [module]\""},{"fix":"Ensure commonjs() plugin is added to plugins array before autoNamedExports() as shown in quickstart.","cause":"rollup-plugin-commonjs not included or configured before autoNamedExports()","error":"TypeError: Cannot read properties of undefined (reading 'namedExports')"},{"fix":"Use alternative solutions like @rollup/plugin-commonjs with namedExports manually or upgrade the plugin if a newer version exists.","cause":"Plugin is not compatible with newer Rollup versions (v3+)","error":"The plugin \"auto-named-exports\" does not support Rollup v3+"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}