grunt-es6-module-transpiler
raw JSON → 0.0.1 verified Fri May 01 auth: no javascript deprecated
A Grunt task for transpiling ES6 module import/export syntax into AMD, CommonJS, YUI, or globals. Current version 0.5.0 (released Oct 2013) supports es6-module-transpiler v0.3.0. Legacy plugin for Grunt 0.4.x with no updates since 2013. Key differentiator: allowed early ES6 module transpilation in Grunt builds but is now outdated; replaced by modern tools like Babel. Requires peer dependency grunt ~0.4.1. Not maintained.
Common errors
error Warning: Task "transpile" not found ↓
cause Missing grunt.loadNpmTasks('grunt-es6-module-transpiler') in Gruntfile.
fix
Add grunt.loadNpmTasks('grunt-es6-module-transpiler'); after initConfig.
error TypeError: Cannot read property 'files' of undefined ↓
cause Missing files configuration in the transpile target.
fix
Ensure each target has a files array with src and dest (or expand pattern).
Warnings
deprecated Package unmaintained since 2013. Use modern tooling like Babel or esbuild. ↓
fix Migrate to a current transpiler (e.g., @babel/preset-env with Grunt or standalone).
breaking v0.5.0 removed transpile:enable task due to es6-module-transpiler v0.3.0 changes. ↓
fix Remove usage of transpile:enable; the feature no longer exists.
gotcha Strict mode is enforced; Chai's arguments.callee usage will cause errors. ↓
fix Use expect.js or other assertion libraries that don't rely on non-strict features.
Install
npm install toranb-grunt-es6-module-transpiler yarn add toranb-grunt-es6-module-transpiler pnpm add toranb-grunt-es6-module-transpiler Imports
- Gruntfile config wrong
const transpile = require('grunt-es6-module-transpiler')correctgrunt.initConfig({ transpile: { ... } })
Quickstart
module.exports = function(grunt) {
grunt.initConfig({
transpile: {
main: {
type: 'amd',
files: [{
expand: true,
cwd: 'lib/',
src: ['**/*.js'],
dest: 'tmp/'
}]
}
}
});
grunt.loadNpmTasks('grunt-es6-module-transpiler');
grunt.registerTask('default', ['transpile']);
};