Registry / devops / mimosa-esperanto-es6-modules

mimosa-esperanto-es6-modules

JSON →
library0.3.4jsnpmunverified

An ES6 module transpiler plugin for Mimosa build tool that uses Esperanto to convert ES6 module syntax (import/export) to AMD or CommonJS compatible JavaScript with inline source maps. Version 0.3.4 is the latest release; the package appears to be in maintenance mode, with no updates since 2015. It wraps the now-deprecated Esperanto library, which was a predecessor to Babel-like tools. Key differentiator: integrates directly with Mimosa's asset pipeline, allowing automatic transpilation during build. Alternative to Babel integration for Mimosa, but limited to module syntax transpilation only (no ES6 features like arrow functions, classes, etc.). Requires Node >=0.10.

npm install mimosa-esperanto-es6-modules
INSTALL
IMPORT
SIG · MIMOSA-ESPERANTO-E
M
mimosa-esperanto-es6-modules
devopsjavascriptv0.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

esperanto
import esperanto from 'esperanto'
var esperanto = require('esperanto')
Esperanto library is the dependency; this module is a Mimosa plugin, typically not imported directly by user code.
mimosa-esperanto-es6-modules (plugin config)
Add 'esperanto-es6-modules' to your mimosa config's `modules` array in `mimosa-config.js`
Adding the package name directly as a module without the 'esperanto-es6-modules' string
Mimosa automatically discovers the plugin when the module name is listed in config.
EsperantoOptions (TypeScript)
type EsperantoOptions = { type: 'amd' | 'commonjs'; exclude: RegExp[]; options: { strict: boolean } }
Directly typing as any
Not bundled with types; user must define or use @types/esperanto.

Shows how to configure mimosa-esperanto-es6-modules in a Mimosa project to transpile ES6 modules to CommonJS.

// In mimosa-config.js module.exports = { modules: ['esperanto-es6-modules'], esperanto: { type: 'commonjs', exclude: [/[/\\]vendor[/\\]/, /[/\\]main[\.-]/, /\.main\.js$/, /[/\\]common\.js$/], options: { strict: true } } }; // Input (ES6 module): src/app.js import { version } from './utils'; export function greet() { return 'Hello ' + version; } // Output (CommonJS via mimosa build) var esperanto = require('esperanto'); // Mimosa processes files automatically; no direct call needed.
Debug
Known issues
deprecatedEsperanto is no longer maintained; use Babel or similar instead.
fix
Switch to a more modern transpiler like mimosa-babel or mimosa-es6-transpiler.
affects: >=0.0.0
gotchaOnly transpiles ES6 module syntax, not other ES6 features (e.g., arrow functions, classes).
fix
Use additional transpiler for other ES6 features, or migrate to a full-featured transpiler like Babel.
affects: >=0.0.0
breakingNode >=0.10 only supported; may not work on Node 6+ without issues.
fix
Use Node 0.10 to 0.12 for guaranteed compatibility, or upgrade to alternative plugin.
affects: >=0.0.0
gotchaCoffeeScript users must wrap import/export in backticks to avoid being transpiled by CoffeeScript.
fix
Enclose ES6 module syntax in backticks within CoffeeScript files.
affects: >=0.0.0
deprecatedmimosa-esperanto-es6-modules version 0.3.4 is the final release; no future updates.
fix
Consider using mimosa-babel or mimosa-webpack.
affects: 0.3.4
Errors
Common errors & fixes
Error: Cannot find module 'esperanto'
esperanto dependency not installed (missing from node_modules).
fix
Ensure esperanto is installed: npm install esperanto --save-dev, or run 'mimosa install' if using Mimosa's module system.
SyntaxError: Unexpected token import
Mimosa is not configured to use the module; the 'esperanto-es6-modules' module is missing from the modules list.
fix
Add 'esperanto-es6-modules' to the modules array in mimosa-config.js.
TypeError: Cannot read property 'type' of undefined
esperanto configuration object is missing or nil in mimosa-config.
fix
Ensure the 'esperanto' property exists in the exported config object (e.g., esperanto: { type: 'amd' }).
Upgrade
Version history
0.3.4latest on npm
Audit
Dependencies
esperantorequiredCore transpilation engine for ES6 module syntax
Agent activity
2 hits · last 30 days
node
2
Resources
mimosa-esperanto-es6-modules — npm install mimosa-esperanto-es6-modules · libregistry