{"id":25660,"library":"grunt-bundle-jsnext-lib","title":"grunt-bundle-jsnext-lib","description":"Grunt plugin to bundle ES6 modules into a single file for browsers or CommonJS for Node.js. Version 0.5.0 is the latest stable release (last updated 2017). Relies on es6-module-transpiler and a custom npm resolver. Differentiators: supports jsnext:main for publishing ES6 modules via npm, multiple output formats (bundle, CJS, system.register), and source maps. Development has been inactive since 2017; consider modern alternatives like rollup or webpack.","status":"deprecated","version":"0.5.0","language":"javascript","source_language":"en","source_url":"git://github.com/caridy/grunt-bundle-jsnext-lib","tags":["javascript","gruntplugin"],"install":[{"cmd":"npm install grunt-bundle-jsnext-lib","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-bundle-jsnext-lib","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-bundle-jsnext-lib","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required to run the plugin","package":"grunt","optional":false}],"imports":[{"note":"Plugin is a Grunt multi-task; load via grunt.loadNpmTasks in Gruntfile, not direct require.","wrong":"const bundleJsnext = require('grunt-bundle-jsnext-lib');","symbol":"grunt.loadNpmTasks","correct":"grunt.loadNpmTasks('grunt-bundle-jsnext-lib');"},{"note":"Task name is bundle_jsnext (or cjs_jsnext), defined in initConfig, not registered manually.","wrong":"grunt.registerTask('bundle', 'grunt-bundle-jsnext-lib');","symbol":"bundle_jsnext","correct":"grunt.initConfig({ bundle_jsnext: { ... } });"},{"note":"Requires a target (e.g., 'library') and dest must be a directory for CJS format.","wrong":"cjs_jsnext: { dest: 'lib/' }","symbol":"cjs_jsnext","correct":"grunt.initConfig({ cjs_jsnext: { library: { options: { main: 'src/main.js' }, dest: 'lib/' } } });"}],"quickstart":{"code":"// Install: npm install grunt grunt-bundle-jsnext-lib --save-dev\n// Gruntfile.js\nmodule.exports = function(grunt) {\n  grunt.loadNpmTasks('grunt-bundle-jsnext-lib');\n  grunt.initConfig({\n    bundle_jsnext: {\n      library: {\n        options: {\n          namespace: 'MyLib'\n        },\n        dest: 'dist/my-lib.js'\n      }\n    },\n    cjs_jsnext: {\n      library: {\n        dest: 'lib/'\n      }\n    }\n  });\n  grunt.registerTask('default', ['bundle_jsnext', 'cjs_jsnext']);\n};","lang":"javascript","description":"Gruntfile configuration with bundle_jsnext and cjs_jsnext tasks."},"warnings":[{"fix":"Migrate to a modern bundler like Rollup, Webpack, or Babel.","message":"Project is unmaintained since 2017; no support for modern ES module syntax or newer Grunt versions.","severity":"deprecated","affected_versions":"*"},{"fix":"Use bundle_jsnext for browser global or cjs_jsnext for CommonJS. No UMD output.","message":"As of v0.2.0, UMD format was removed; only 'bundle' and 'cjs' formats are supported.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Ensure dest is a file path for bundle_jsnext and a directory path for cjs_jsnext.","message":"dest must be a file for bundle_jsnext task, but a directory for cjs_jsnext task.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Switch to a transpiler that supports ES modules natively.","message":"Depends on es6-module-transpiler which is no longer maintained. Use of esprima-fb may cause compatibility issues with modern Node.js.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure grunt.loadNpmTasks('grunt-bundle-jsnext-lib') is in Gruntfile and npm install grunt-bundle-jsnext-lib --save-dev is run.","cause":"grunt.loadNpmTasks not called or package not installed.","error":"Warning: Task \"bundle_jsnext\" not found."},{"fix":"Change dest to a file path (e.g., 'dist/library.js') for bundle_jsnext.","cause":"Using bundle_jsnext but dest points to a directory instead of a file.","error":"Fatal error: Unable to write destination file \"dest/path/\" (code: EISDIR)."},{"fix":"Run npm install es6-module-transpiler --save-dev alongside this plugin.","cause":"Missing dependency es6-module-transpiler.","error":"Error: Cannot find module 'es6-module-transpiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}