{"id":19033,"library":"babel-plugin-compact-reexports","title":"babel-plugin-compact-reexports","description":"A Babel plugin that optimizes ES module re-exports in AMD by replacing verbose definitions with concise alias calls. Version 1.1.0 is the latest stable release. The plugin targets Ember applications using loader.js but can work with any AMD loader supporting alias API. Differentiator: drastically reduces boilerplate for re-export-only modules, saving bytes over the wire in production builds.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ember-engines/babel-plugin-compact-reexports","tags":["javascript","babel-plugin","amd","ember"],"install":[{"cmd":"npm install babel-plugin-compact-reexports","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-compact-reexports","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-compact-reexports","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Babel plugin requires Babel to run","package":"@babel/core","optional":false}],"imports":[{"note":"CommonJS require works in Node/Babel config files; default export is the plugin.","wrong":"const plugin = require('babel-plugin-compact-reexports')","symbol":"babel-plugin-compact-reexports","correct":"import plugin from 'babel-plugin-compact-reexports'"},{"note":"Babel allows shorthand plugin name without 'babel-plugin-' prefix.","wrong":"module.exports = { plugins: ['babel-plugin-compact-reexports'] }","symbol":"babel-plugin-compact-reexports","correct":"module.exports = { plugins: ['compact-reexports'] }"},{"note":"CommonJS require is acceptable in babel.config.js or .babelrc.","wrong":null,"symbol":"babel-plugin-compact-reexports","correct":"require('babel-plugin-compact-reexports')"}],"quickstart":{"code":"// .babelrc.js\nmodule.exports = {\n  plugins: ['compact-reexports']\n};\n\n// Input: my-module.js\nexport { default } from 'their-module';\n\n// Compiled output:\ndefine.alias('their-module', 'my-module');","lang":"javascript","description":"Shows Babel configuration and the optimization from verbose AMD define to compact alias."},"warnings":[{"fix":"Ensure Babel is configured to output AMD modules, e.g., using @babel/plugin-transform-modules-amd.","message":"Plugin only works with AMD module format. If not using AMD (e.g., CommonJS or ESM output), the plugin does nothing.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Verify your AMD loader supports similar alias functionality, or avoid using this plugin.","message":"Alias relies on loader.js API. Custom AMD loaders without alias support will ignore the alias call, potentially causing module resolution failures.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Simplify re-exports to plain default or star exports to benefit from compaction.","message":"Only handles re-exports of the form 'export { default } from ...' or 'export * from ...'. Complex re-exports (renamed, multiple) are not optimized.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-plugin-compact-reexports --save-dev' and ensure Babel config has 'compact-reexports' in plugins array.","cause":"Using an incorrect plugin name or not installing the plugin","error":"Error: .plugins[0][0] must be a string, object, function"},{"fix":"Run 'npm install babel-plugin-compact-reexports --save-dev'.","cause":"Plugin not installed in local node_modules","error":"Cannot find module 'babel-plugin-compact-reexports'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}