Registry / devops / babel-plugin-compact-reexports

babel-plugin-compact-reexports

JSON →
library1.1.0jsnpmunverified

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.

npm install babel-plugin-compact-reexports
INSTALL
IMPORT
SIG · BABEL-PLUGIN-COMPA
B
babel-plugin-compact-reexports
devopsjavascriptv1.1.0
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

babel-plugin-compact-reexports
import plugin from 'babel-plugin-compact-reexports'
const plugin = require('babel-plugin-compact-reexports')
CommonJS require works in Node/Babel config files; default export is the plugin.
babel-plugin-compact-reexports
module.exports = { plugins: ['compact-reexports'] }
module.exports = { plugins: ['babel-plugin-compact-reexports'] }
Babel allows shorthand plugin name without 'babel-plugin-' prefix.
babel-plugin-compact-reexports
require('babel-plugin-compact-reexports')
CommonJS require is acceptable in babel.config.js or .babelrc.

Shows Babel configuration and the optimization from verbose AMD define to compact alias.

// .babelrc.js module.exports = { plugins: ['compact-reexports'] }; // Input: my-module.js export { default } from 'their-module'; // Compiled output: define.alias('their-module', 'my-module');
Debug
Known issues
gotchaPlugin only works with AMD module format. If not using AMD (e.g., CommonJS or ESM output), the plugin does nothing.
fix
Ensure Babel is configured to output AMD modules, e.g., using @babel/plugin-transform-modules-amd.
affects: >=1.0
gotchaAlias relies on loader.js API. Custom AMD loaders without alias support will ignore the alias call, potentially causing module resolution failures.
fix
Verify your AMD loader supports similar alias functionality, or avoid using this plugin.
affects: >=1.0
gotchaOnly handles re-exports of the form 'export { default } from ...' or 'export * from ...'. Complex re-exports (renamed, multiple) are not optimized.
fix
Simplify re-exports to plain default or star exports to benefit from compaction.
affects: >=1.0
Errors
Common errors & fixes
Error: .plugins[0][0] must be a string, object, function
Using an incorrect plugin name or not installing the plugin
fix
Run 'npm install babel-plugin-compact-reexports --save-dev' and ensure Babel config has 'compact-reexports' in plugins array.
Cannot find module 'babel-plugin-compact-reexports'
Plugin not installed in local node_modules
fix
Run 'npm install babel-plugin-compact-reexports --save-dev'.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
@babel/corerequiredBabel plugin requires Babel to run
Agent activity
4 hits · last 30 days
node
4
Resources
babel-plugin-compact-reexports — npm install babel-plugin-compact-reexports · libregistry