Registry / web-framework / dynapack

dynapack

JSON →
library0.4.11jsnpmunverified

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.

npm install dynapack
INSTALL
IMPORT
SIG · DYNAPACK
D
dynapack
web-frameworkjavascriptv0.4.11
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dynapack
const dynapack = require('dynapack');
import dynapack from 'dynapack';
CJS-only, no ESM support. Use require() for both API and CLI.
ensure
var ensure = require('node-ensure');
import ensure from 'node-ensure';
node-ensure is CJS-only; required for dynamic dependencies.
global
// In browser bundle, dynapack injects modules into global scope
import { dynapack } from 'dynapack/client';
No client-side import; bundles are loaded via script tags.

Builds bundles from an entry module with static and dynamic dependencies, writing each bundle to disk.

const dynapack = require('dynapack'); const path = require('path'); const fs = require('fs'); const mainPath = path.resolve('./main.js'); const options = { dest: './build' }; dynapack.build(mainPath, options, function(err, bundles) { if (err) throw err; bundles.forEach(function(bundle) { const outPath = path.join(options.dest, bundle.id + '.js'); fs.writeFileSync(outPath, bundle.source); console.log('Wrote ' + outPath); }); });
dynapack --version
Debug
Known issues
deprecatedPackage is alpha, abandoned, and not maintained since 2017.
fix
Consider Webpack, Rollup, or Parcel for modern bundling.
affects: all
gotchaDynamic dependencies require node-ensure and a specific string comment syntax.
fix
Use the exact pattern: var __m = './path' /*js*/; followed by ensure([__m], cb).
affects: <0.5
gotchaBundles are not minified; you must run an external minifier like uglify-js.
fix
Pipe bundle source through uglify-js: uglifyjs bundle.js -c -m -o bundle.min.js
affects: all
breakingNo ESM support; cannot import/export ES modules.
fix
Use CommonJS require() syntax only.
affects: all
gotchaThe API callback provides bundles array; each has .id, .source, and .dependencies. No promise version.
fix
Use the callback pattern or promisify manually.
affects: all
Errors
Common errors & fixes
Cannot find module 'node-ensure'
node-ensure is not installed but required for dynamic dependencies.
fix
npm install node-ensure
dynapack is not defined
Using import instead of require in Node.js.
fix
Use const dynapack = require('dynapack');
SyntaxError: Unexpected token
ES module syntax used; dynapack only parses CommonJS.
fix
Rewrite to CommonJS: var x = require('module');
No bundles generated
Entry file does not exist or path incorrect.
fix
Check that the mainPath resolves to a valid .js file.
Upgrade
Version history
0.4.11latest on npm
Audit
Dependencies
node-ensurerequiredRequired for dynamic dependency declarations in runtime (browser and Node).
Agent activity
4 hits · last 30 days
node
4
Resources
dynapack — npm install dynapack · libregistry