{"id":25670,"library":"grunt-es6-module-wrap-default","title":"grunt-es6-module-wrap-default","description":"Grunt plugin (v0.2.0) that wraps CommonJS and AMD modules generated by es6-module-transpiler so they can be required by their name rather than requiring `.default`. It helps transition from ES6 modules to CommonJS/AMD without changing consumer code. The plugin is minimal, specific to the es6-module-transpiler output, and provides a `type` option to choose between CJS and AMD wrapping. Release cadence is unknown; last release was 2014. It has no known alternatives for this exact use case.","status":"abandoned","version":"0.2.0","language":"javascript","source_language":"en","source_url":"git://github.com/stevoland/grunt-es6-module-wrap-default","tags":["javascript","gruntplugin"],"install":[{"cmd":"npm install grunt-es6-module-wrap-default","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-es6-module-wrap-default","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-es6-module-wrap-default","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency (Grunt ~0.4.2) required for plugin to work","package":"grunt","optional":false}],"imports":[{"note":"Grunt plugin: register via loadNpmTasks, not import.","wrong":"import es6_module_wrap_default from 'grunt-es6-module-wrap-default';","symbol":"es6_module_wrap_default","correct":"grunt.loadNpmTasks('grunt-es6-module-wrap-default');"},{"note":"Task name in config must be string 'es6_module_wrap_default' as per Grunt convention.","wrong":"grunt.initConfig({ es6ModuleWrapDefault: { ... } });","symbol":"es6_module_wrap_default task config","correct":"grunt.initConfig({ es6_module_wrap_default: { ... } });"},{"note":"Only 'cjs' or 'amd' are accepted; 'format' is not a valid option.","wrong":"options: { format: 'amd' }","symbol":"options.type","correct":"options: { type: 'cjs' }"}],"quickstart":{"code":"// Install: npm install grunt-es6-module-wrap-default --save-dev\n// In Gruntfile.js:\nmodule.exports = function(grunt) {\n  grunt.loadNpmTasks('grunt-es6-module-wrap-default');\n  grunt.initConfig({\n    es6_module_wrap_default: {\n      options: {\n        type: 'cjs'\n      },\n      files: [{\n        expand: true,\n        cwd: 'cjs/transpiled',\n        src: ['**/*.js'],\n        dest: 'cjs'\n      }]\n    }\n  });\n  grunt.registerTask('default', ['es6_module_wrap_default']);\n};","lang":"javascript","description":"Registers the Grunt task and configures it to wrap CJS files from a source directory to an output directory, enabling require('name') instead of require('name').default."},"warnings":[{"fix":"Verify that your modules were generated by es6-module-transpiler.","message":"Only works with output from es6-module-transpiler; other ES6 transpilers may not produce compatible modules.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to Babel or TypeScript, which handle imports directly and do not require wrapping.","message":"es6-module-transpiler is deprecated; consider using Babel or TypeScript for ES6 module transpilation.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure the property name exactly matches 'es6_module_wrap_default'.","message":"Task configuration uses 'es6_module_wrap_default' as the property name; misspelling or incorrect casing will not throw an error—silent failure.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Double-check file glob patterns and cwd.","message":"If no files are matched, the task completes without any output—no error.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add `grunt.loadNpmTasks('grunt-es6-module-wrap-default');` to your Gruntfile.","cause":"The task is not registered; grunt.loadNpmTasks was not called or the plugin is not installed.","error":"Warning: Task \"es6_module_wrap_default\" not found."},{"fix":"Ensure your Gruntfile has a property named exactly 'es6_module_wrap_default' with valid options.","cause":"Invalid configuration; the property name may be misspelled or options are not an object.","error":"Fatal error: Unable to read task \"es6_module_wrap_default\" options."},{"fix":"Check the file paths and cwd in the files configuration.","cause":"The source file glob pattern is incorrect or the directory does not exist.","error":"No files matched."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}