Requisite is a JavaScript bundler that focuses on compiling client-side code and templates, primarily utilizing the CommonJS module format. As of version 1.19.17, it enables developers to structure browser-side applications using Node.js-style `require` statements, supporting both synchronous and asynchronous module loading for optimized performance. Key differentiators include automatic compiler detection for various languages, a flexible API for programmatic use, lazy asset loading, and integration with `connect`/`express` for rapid development. It also offers a command-line interface for straightforward bundling tasks and good source map support. It explicitly directs users interested in ES module support to an alternative project, Handroll, indicating its dedicated focus on CommonJS and an older paradigm for module management. Requisite's release cadence appears to be slow or ceased, given its long-standing version and the explicit guidance away from it for modern ES module workflows.
npm install requisiteVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core CLI functionality of Requisite by bundling a simple CommonJS module with an asynchronous dependency into a single output file. It shows how Requisite processes `require` statements and handles lazy loading, creating necessary project files and then invoking the bundler.
Migrate to a modern bundler like Webpack, Rollup, or Vite, or convert ES modules to CommonJS before bundling with Requisite.
Always be mindful of the `require` signature within Requisite-bundled code. If asynchronous loading is not desired, ensure `require` is used synchronously without a callback.
For new projects, consider modern bundlers that fully support ES Modules and the latest JavaScript standards. For existing projects using Requisite, ensure your Node.js environment and dependencies are compatible with its older runtime requirements.
Ensure the required module exists at the specified relative path or is correctly installed in `node_modules`. Check `requisite --base` option if paths are relative to a different base directory.
Ensure the Requisite bundle includes its prelude (`--no-prelude` option is not used) and is executed in the target environment (e.g., browser) where the `require` function is made globally available by the bundler.
Ensure all files intended for bundling with Requisite are pure CommonJS modules, or transpile ES Modules to CommonJS before feeding them to Requisite. Alternatively, switch to a bundler that supports ES Modules.
No dependency data recorded yet.