Registry / devops / grunt-es6-module-transpiler-rhengles

grunt-es6-module-transpiler-rhengles

JSON →
library0.5.0jsnpmunverified

A Grunt task for processing ES6 module import/export syntax into AMD, CommonJS, or globals using the es6-module-transpiler. Current stable version: 0.5.0. Released infrequently, last update 2013. Differentiators: integrates with Grunt build system, offers transpile:enable task to temporarily enable ES6 modules for other tasks. Note: outdated and unmaintained, the underlying transpiler is superseded by Babel.

npm install grunt-es6-module-transpiler-rhengles
INSTALL
IMPORT
SIG · GRUNT-ES6-MODULE-T
G
grunt-es6-module-transpiler-rhengles
devopsjavascriptv0.5.0
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.

transpile
grunt.loadNpmTasks('grunt-es6-module-transpiler');
grunt.loadNpmTasks('grunt-es6-module-transpiler'); // correct, no common mistake
Registers the 'transpile' task. No import needed, it's a Grunt plugin.
transpile:enable
grunt.registerTask('test', ['transpile:enable', 'mocha']);
grunt.registerTask('test', ['transpile', 'mocha']); // runs transpile task instead of enabling
The :enable subtask temporarily enables ES6 module syntax for other Node scripts.

Registers the transpile task and configures it to convert ES6 modules to CommonJS.

// Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('grunt-es6-module-transpiler'); grunt.initConfig({ transpile: { main: { type: 'cjs', files: [{ expand: true, cwd: 'lib/', src: ['**/*.js'], dest: 'tmp/' }] } } }); grunt.registerTask('default', ['transpile']); };
Debug
Known issues
deprecatedThis plugin and its underlying es6-module-transpiler are deprecated in favor of Babel.
fix
Migrate to @babel/preset-env or @babel/plugin-transform-modules-commonjs with Grunt via grunt-babel.
affects: >=0.1.0
gotchaThe transpiler forces strict mode, causing issues with libraries like Chai that use arguments.callee.
fix
Switch to expect.js or another assertion library that works in strict mode.
affects: >=0.1.0
breakingNode >= 0.8.0 required, may not work with recent Node versions.
fix
Use a compatible Node version or migrate to a modern transpiler.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'es6-module-transpiler'
Missing runtime dependency es6-module-transpiler.
fix
npm install es6-module-transpiler --save-dev
Warning: Task "transpile" not found. Use --force to continue.
Plugin not loaded or not installed.
fix
Ensure grunt-es6-module-transpiler is installed and grunt.loadNpmTasks('grunt-es6-module-transpiler'); is called.
TypeError: Cannot read property 'files' of undefined
Missing or incorrect Grunt configuration for transpile task.
fix
Add a transpile configuration block in grunt.initConfig as shown in the docs.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
gruntrequiredpeer dependency, required for Grunt plugin
es6-module-transpilerrequiredruntime dependency for transpilation
Agent activity
6 hits · last 30 days
node
6
Resources
grunt-es6-module-transpiler-rhengles — npm install grunt-es6-module-transpiler-rhengles · libregistry