One file per module
Each webpack/rspack module is written to modules/<id>.js. ES-module chunks go to chunks/ and original sources to sources/.
Packscope turns a single shipped bundle — from webpack, rspack, rollup, esbuild, or Vite — into a navigable project tree that you can read, grep, edit, and run.
$ npx packscope ./dist/app.js ./out
# webpack/rspack output
out/
├── header.js
├── webpack-runtime.js
├── runtime.js
├── index.js
├── modules/<id>.js
├── manifest.json
├── rebuild.js
└── package.json
$ node out/index.js --version
2.106.4Features
Each webpack/rspack module is written to modules/<id>.js. ES-module chunks go to chunks/ and original sources to sources/.
The loader reconstructs the original bundle shape using the real UMD header and webpack runtime, so the unpacked tree runs identically.
Modify any module, then run node out/rebuild.js bundle-edited.js to regenerate a single runnable bundle.
Pass an http:// or https:// URL. Packscope downloads the bundle, resolves chunks, and rewrites imports to local paths.
manifest.json contains IDs, sizes, dependency edges, inferred names, and downloaded assets for further analysis.
Use --beautify and --rename for readable output. Defaults keep original slices for guaranteed execution.
Internals
Acorn locates the webpack modules dictionary and maps every module boundary.
Each module body is sliced verbatim from the bundle. No AST rewrite means no statement-order surprises.
runtime.js rebuilds the original expression: header + delegator-filled modules + original runtime.
Externals like chokidar are detected from shim patterns and wired through the same UMD path as the original.
Quick Start
npm installnpx packscope ./dist/app.js ./outnpx packscope https://example.com/app.js ./outnode out/index.js --version
node out/index.js --help--beautify — pretty-print output (best-effort)--decompose — extract classes / services / wrappers for navigation (ES modules)--rename — rename wrapper params to module/exports/require--fetch-assets / --no-fetch-assets — control source-map / asset downloads--entry <N> — force entry module idecho "// patched" >> out/modules/92367.js
node out/rebuild.js bundle-patched.js
node bundle-patched.js --versionClone the repo and unpack your first mono bundle in seconds.