grunt-esperanto

raw JSON →
0.4.0 verified Fri May 01 auth: no javascript deprecated

Grunt plugin wrapping esperanto for transpiling ES6 modules to AMD, CommonJS, or UMD. Version 0.4.0 (last release) supports esperanto's `amdName` option. Designed for use with Grunt ~0.4.5. Key differentiator: integrates esperanto into Grunt build pipeline, providing file-based bundling with configurable output formats. No longer actively maintained; esperanto itself is deprecated in favor of rollup or other bundlers. Release cadence: sporadic, no releases since 2015.

error Warning: Task "esperanto" not found. Use --force to continue.
cause grunt.loadNpmTasks('grunt-esperanto') missing or misspelled.
fix
Add grunt.loadNpmTasks('grunt-esperanto'); to your Gruntfile.
error Fatal error: Cannot find module 'esperanto'
cause Esperanto library not installed. grunt-esperanto depends on it as a peer dependency.
fix
Run npm install esperanto --save-dev
error Running "esperanto:build" (esperanto) task Warning: Unable to write "dest/bundle.js" file (Error code: ENOENT).
cause Destination directory does not exist.
fix
Ensure the dest folder exists or create it before running Grunt.
deprecated Package is deprecated; esperanto is unmaintained. Use rollup or webpack instead.
fix Migrate to rollup with @rollup/plugin-commonjs for similar functionality.
gotcha The task configuration key must be exactly 'esperanto'. Using any other name (e.g., 'esperanto2') will cause Grunt to ignore the configuration silently.
fix Ensure the task name in initConfig matches the package name.
gotcha The 'type' option defaults to 'amd'; not setting it explicitly may produce unexpected output if you expect CJS or UMD.
fix Always set options.type to the desired format.
npm install grunt-esperanto
yarn add grunt-esperanto
pnpm add grunt-esperanto

Shows a minimal Gruntfile that loads the plugin, configures the task to transpile a module to UMD, and sets it as default.

// Install: npm install grunt-esperanto --save-dev
// Gruntfile.js
module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-esperanto');
  grunt.initConfig({
    esperanto: {
      options: { type: 'umd', separator: '\n' },
      build: {
        files: {
          'dist/bundle.js': ['src/module.js']
        }
      }
    }
  });
  grunt.registerTask('default', ['esperanto']);
};