systemjs-route-bundler is a specialized build tool designed to optimize single-page applications built with SystemJS. Instead of creating a single monolithic JavaScript bundle, it splits an application into multiple smaller bundles based on top-level routes. This approach aims to significantly reduce initial page load times by lazy-loading route-specific code as needed. It leverages SystemJS Builder internally to perform the bundling operations. The current stable version is 1.6.0. Given the project's last commit was around 2018 and the JavaScript module ecosystem has rapidly evolved, it is largely suited for legacy SystemJS-based applications and is considered abandoned. Its key differentiator was providing intelligent, route-based code splitting specifically for SystemJS, particularly useful when paired with solutions like ocLazyLoad-SystemJS-Router to enhance application load performance.
npm install systemjs-route-bundlerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate systemjs-route-bundler into a Gulp build script to generate route-specific bundles for a SystemJS application. This example includes a full configuration object and assumes a basic project structure.
For new projects, strongly consider migrating to modern bundlers like Webpack, Rollup, or Vite. For existing legacy projects, explicitly pin specific Node.js and 'systemjs-builder' versions known to be compatible with your setup. Regularly audit dependencies for security issues.
Evaluate the long-term viability of using this tool. If maintaining a legacy SystemJS application, ensure comprehensive testing and consider alternative, actively maintained solutions if migration is feasible.
Thoroughly review your `systemjs.config.js` file and verify that `baseURL` and `routes` paths in your `bundleConfig` are correct and resolve to existing files. Enable `verboseOutput: true` in the configuration to receive more detailed tracing and error information from SystemJS Builder.
Ensure `systemjs-builder` is installed as a dependency (`npm install systemjs-builder`). Check its version requirements and ensure it's compatible with `systemjs-route-bundler` and your Node.js version. Downgrading Node.js or `systemjs-builder` might be necessary.
Verify that your `systemjs.config.js` file is correctly configured and accessible. Check the module paths in your application code and ensure all modules are resolvable relative to the `baseURL`. Use `verboseOutput: true` to obtain more context from the SystemJS Builder error.
Double-check the `routes` array in your `bundleConfig` to ensure it's an array of strings pointing to valid route entry files. Confirm that the `systemConfig` option correctly specifies the path to an existing and valid SystemJS configuration file.