How redstarbird/arrowpack works
ArrowPack is a web bundler with a Node.js CLI and an Emscripten-compiled native core. The principal workflow takes project settings and entry files, discovers dependencies, orders them, and bundles files; plugin validation and transformation are additional stages. In development mode, file changes trigger native incremental rebuilding and the server sends updates to clients. The README identifies HTML includes and JavaScript module bundling as implemented; it marks CSS bundling and HTML/CSS minification as unimplemented. Some internal calls are not shown in the excerpts, so the graph omits those links rather than inferring them.
Main entry points: arrowpack.js ArrowPack CLI · Main.c Native runtime bridge · DevServer.js Development server · Plugins.c Plugin validation
Components 16
CLI and configuration
- ArrowPack CLI
bin/arrowpack.js - Settings
src/node/config.js
Native bundling core
- Native runtime bridge
src/native/bridge/Main.c - Dependency graph
src/native/graph/DependencyGraph.c - File type handling
src/native/graph/FileTypesHandler.c - File bundling
src/native/codegen/BundleFiles.c - HTML and JS minifiers
src/native/minify - File operations
src/native/util/FileUtil.c
Plugins and transforms
- Plugin transforms
src/native/bridge/plugins/Transform.c - Plugin validation
src/native/bridge/plugins/Plugins.c - Validator API
plugin/index.cjs
Development server
- Development server
src/node/server/DevServer.js - File change watcher
bin/arrowpack.js
Other components
- Project developer
- Website source files
- Browser clients
Connections 15
- Project developer → ArrowPack CLI: runs
bin/arrowpack.js - Website source files → ArrowPack CLI: configures
bin/arrowpack.js - ArrowPack CLI → Settings: loads settings
bin/arrowpack.js - ArrowPack CLI → Native runtime bridge: calls native API
bin/arrowpack.js - Native runtime bridge → Dependency graph: finds dependents
src/native/bridge/Main.c - Native runtime bridge → File bundling: rebundles files
src/native/bridge/Main.c - Native runtime bridge → File type handling: classifies new files
src/native/bridge/Main.c - ArrowPack CLI → Plugin validation: invokes validators
bin/arrowpack.js - ArrowPack CLI → Plugin transforms: invokes transforms
bin/arrowpack.js - Plugin validation → Validator API: calls validator
- ArrowPack CLI → File change watcher: watches entry
bin/arrowpack.js - File change watcher → Native runtime bridge: requests rebuild
bin/arrowpack.js - ArrowPack CLI → Development server: starts server
bin/arrowpack.js - ArrowPack CLI → Development server: sends updates
bin/arrowpack.js - Development server → Browser clients: serves pages