{"id":18284,"library":"dynapack","title":"Dynapack","description":"A JavaScript module bundler and client-side loader that constructs a minimal set of bundles for dependency graphs with both static and dynamic dependencies. Version 0.4.11 (alpha, last release 2017) supports CommonJS static requires and node-ensure dynamic declarations, targeting isomorphic apps. Unlike Browserify or Webpack, it handles the 'dynamic dependency diamond' by ensuring each module is in exactly one bundle and dynamic requests deliver only the required static subgraph. Works on Node.js and in browsers via generated bundles.","status":"abandoned","version":"0.4.11","language":"javascript","source_language":"en","source_url":"git://github.com/bauerca/dynapack","tags":["javascript","bundle","loader","module","commonjs","dynamic","dependency"],"install":[{"cmd":"npm install dynapack","lang":"bash","label":"npm"},{"cmd":"yarn add dynapack","lang":"bash","label":"yarn"},{"cmd":"pnpm add dynapack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for dynamic dependency declarations in runtime (browser and Node).","package":"node-ensure","optional":false}],"imports":[{"note":"CJS-only, no ESM support. Use require() for both API and CLI.","wrong":"import dynapack from 'dynapack';","symbol":"dynapack","correct":"const dynapack = require('dynapack');"},{"note":"node-ensure is CJS-only; required for dynamic dependencies.","wrong":"import ensure from 'node-ensure';","symbol":"ensure","correct":"var ensure = require('node-ensure');"},{"note":"No client-side import; bundles are loaded via script tags.","wrong":"import { dynapack } from 'dynapack/client';","symbol":"global","correct":"// In browser bundle, dynapack injects modules into global scope"}],"quickstart":{"code":"const dynapack = require('dynapack');\nconst path = require('path');\nconst fs = require('fs');\n\nconst mainPath = path.resolve('./main.js');\nconst options = { dest: './build' };\n\ndynapack.build(mainPath, options, function(err, bundles) {\n  if (err) throw err;\n  bundles.forEach(function(bundle) {\n    const outPath = path.join(options.dest, bundle.id + '.js');\n    fs.writeFileSync(outPath, bundle.source);\n    console.log('Wrote ' + outPath);\n  });\n});","lang":"javascript","description":"Builds bundles from an entry module with static and dynamic dependencies, writing each bundle to disk."},"warnings":[{"fix":"Consider Webpack, Rollup, or Parcel for modern bundling.","message":"Package is alpha, abandoned, and not maintained since 2017.","severity":"deprecated","affected_versions":"all"},{"fix":"Use the exact pattern: var __m = './path' /*js*/; followed by ensure([__m], cb).","message":"Dynamic dependencies require node-ensure and a specific string comment syntax.","severity":"gotcha","affected_versions":"<0.5"},{"fix":"Pipe bundle source through uglify-js: uglifyjs bundle.js -c -m -o bundle.min.js","message":"Bundles are not minified; you must run an external minifier like uglify-js.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CommonJS require() syntax only.","message":"No ESM support; cannot import/export ES modules.","severity":"breaking","affected_versions":"all"},{"fix":"Use the callback pattern or promisify manually.","message":"The API callback provides bundles array; each has .id, .source, and .dependencies. No promise version.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install node-ensure","cause":"node-ensure is not installed but required for dynamic dependencies.","error":"Cannot find module 'node-ensure'"},{"fix":"Use const dynapack = require('dynapack');","cause":"Using import instead of require in Node.js.","error":"dynapack is not defined"},{"fix":"Rewrite to CommonJS: var x = require('module');","cause":"ES module syntax used; dynapack only parses CommonJS.","error":"SyntaxError: Unexpected token"},{"fix":"Check that the mainPath resolves to a valid .js file.","cause":"Entry file does not exist or path incorrect.","error":"No bundles generated"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}