Registry / devops / grunt-bundle-jsnext-lib

grunt-bundle-jsnext-lib

JSON →
library0.5.0jsnpmunverified

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.

npm install grunt-bundle-jsnext-lib
INSTALL
IMPORT
SIG · GRUNT-BUNDLE-JSNEX
G
grunt-bundle-jsnext-lib
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.

grunt.loadNpmTasks
grunt.loadNpmTasks('grunt-bundle-jsnext-lib');
const bundleJsnext = require('grunt-bundle-jsnext-lib');
Plugin is a Grunt multi-task; load via grunt.loadNpmTasks in Gruntfile, not direct require.
bundle_jsnext
grunt.initConfig({ bundle_jsnext: { ... } });
grunt.registerTask('bundle', 'grunt-bundle-jsnext-lib');
Task name is bundle_jsnext (or cjs_jsnext), defined in initConfig, not registered manually.
cjs_jsnext
grunt.initConfig({ cjs_jsnext: { library: { options: { main: 'src/main.js' }, dest: 'lib/' } } });
cjs_jsnext: { dest: 'lib/' }
Requires a target (e.g., 'library') and dest must be a directory for CJS format.

Gruntfile configuration with bundle_jsnext and cjs_jsnext tasks.

// Install: npm install grunt grunt-bundle-jsnext-lib --save-dev // Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('grunt-bundle-jsnext-lib'); grunt.initConfig({ bundle_jsnext: { library: { options: { namespace: 'MyLib' }, dest: 'dist/my-lib.js' } }, cjs_jsnext: { library: { dest: 'lib/' } } }); grunt.registerTask('default', ['bundle_jsnext', 'cjs_jsnext']); };
grunt --version
Debug
Known issues
deprecatedProject is unmaintained since 2017; no support for modern ES module syntax or newer Grunt versions.
fix
Migrate to a modern bundler like Rollup, Webpack, or Babel.
affects: *
breakingAs of v0.2.0, UMD format was removed; only 'bundle' and 'cjs' formats are supported.
fix
Use bundle_jsnext for browser global or cjs_jsnext for CommonJS. No UMD output.
affects: >=0.2.0
gotchadest must be a file for bundle_jsnext task, but a directory for cjs_jsnext task.
fix
Ensure dest is a file path for bundle_jsnext and a directory path for cjs_jsnext.
affects: >=0.4.0
deprecatedDepends on es6-module-transpiler which is no longer maintained. Use of esprima-fb may cause compatibility issues with modern Node.js.
fix
Switch to a transpiler that supports ES modules natively.
affects: *
Errors
Common errors & fixes
Warning: Task "bundle_jsnext" not found.
grunt.loadNpmTasks not called or package not installed.
fix
Ensure grunt.loadNpmTasks('grunt-bundle-jsnext-lib') is in Gruntfile and npm install grunt-bundle-jsnext-lib --save-dev is run.
Fatal error: Unable to write destination file "dest/path/" (code: EISDIR).
Using bundle_jsnext but dest points to a directory instead of a file.
fix
Change dest to a file path (e.g., 'dist/library.js') for bundle_jsnext.
Error: Cannot find module 'es6-module-transpiler'
Missing dependency es6-module-transpiler.
fix
Run npm install es6-module-transpiler --save-dev alongside this plugin.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
gruntrequiredpeer dependency, required to run the plugin
Agent activity
2 hits · last 30 days
node
2
Resources
grunt-bundle-jsnext-lib — npm install grunt-bundle-jsnext-lib · libregistry