Registry / devops / systemjs-route-bundler

systemjs-route-bundler

JSON →
library1.6.0jsnpmunverified

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-bundler
INSTALL
IMPORT
SIG · SYSTEMJS-ROUTE-BUN
S
systemjs-route-bundler
devopsjavascriptv1.6.0
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.

BundlerFunction
const bundler = require('systemjs-route-bundler');
import bundler from 'systemjs-route-bundler';
This package is a CommonJS module that exports a single function. Direct ESM imports are not supported.
BundleConfiguration
// Configuration is a plain JavaScript object passed to the bundler function.
There is no exported type or class for the configuration object. Refer to the package's README or JSDoc for available options and their types.

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.

const gulp = require('gulp'); const path = require('path'); const bundler = require('systemjs-route-bundler'); // --- Dummy Project Setup (for quickstart context) --- // To make this runnable, ensure you have a basic SystemJS project structure: // 1. `systemjs.config.js`: Your SystemJS configuration (e.g., `module.exports = { map: { 'app': 'app' }, packages: { 'app': { defaultExtension: 'js' } } };`) // 2. `app/main.js`: Your application's main entry point (e.g., `console.log('Main app loaded'); import './routes/home/index';`) // 3. `app/routes/home/index.js`: A route entry file (e.g., `import '../shared/data.js'; console.log('Home route loaded');`) // 4. `app/routes/about/index.js`: Another route entry file (e.g., `import '../shared/data.js'; console.log('About route loaded');`) // 5. `app/routes/contact/index.js`: A third route entry file (e.g., `console.log('Contact route loaded');`) // 6. `app/shared/data.js`: A shared module (e.g., `export const data = 'shared data';`) const bundleConfig = { baseURL: '.', // Base URL for your project files dest: 'dist', // Destination directory for the output bundles main: 'app/main.js', // The main entry file of your application destMain: 'dist/app/main.js', // Destination path for the main bundle routes: [ 'app/routes/home/index.js', 'app/routes/about/index.js', 'app/routes/contact/index.js' ], // Array of top-level route files to be bundled separately bundleThreshold: 0.6, // Ratio of routes including a module for it to be bundled in the main bundle systemConfig: 'systemjs.config.js', // Path to your SystemJS configuration file sourceMaps: true, // Generate source maps for debugging minify: false, // Do not minify the output JavaScript mangle: false, // Do not mangle variable names verboseOutput: true, // Output detailed debug information during bundling ignoredPaths: [ 'node_modules/*' // Example: ignore external libraries from the bundling logic ] }; gulp.task('bundle-systemjs-routes', async function() { console.log('Initiating SystemJS route bundling...'); try { await bundler(bundleConfig); console.log('SystemJS route bundling completed successfully!'); } catch (error) { console.error('SystemJS route bundling failed:', error); process.exit(1); } }); // To run this Gulp task: // 1. Install Gulp globally (`npm install -g gulp-cli`) and locally (`npm install --save-dev gulp`). // 2. Create the dummy project files as described above. // 3. Run `gulp bundle-systemjs-routes` in your terminal.
systemjs-route-bundler --version
Debug
Known issues
breakingThe underlying 'systemjs-builder' project, which this package relies on, is no longer actively maintained. This leads to potential compatibility issues with newer Node.js versions, unresolved dependency vulnerabilities, and lack of support for modern JavaScript features or module resolution strategies.
fix
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.
affects: >=1.0.0
gotchaThis package itself is considered abandoned, with no active development or maintenance since approximately 2018. It is not recommended for new projects and should be used with extreme caution in existing ones, especially regarding security updates or compatibility with ecosystem changes.
fix
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.
affects: >=1.0.0
gotchaIncorrect SystemJS configuration (e.g., `baseURL`, `systemConfig` path, `map`, `paths`, `packages`) or misconfigured `routes` options can lead to module resolution errors or incomplete/incorrect bundles. The error messages from the underlying `systemjs-builder` can sometimes be cryptic.
fix
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.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'systemjs-builder'
The core dependency 'systemjs-builder' is either not installed or its version is incompatible with the bundler or your Node.js environment.
fix
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.
SystemJS Builder Error: Error: Unable to resolve 'some/module' from 'another/module.js'
SystemJS's module resolution failed for a specific module during the bundling process, often due to an incorrect SystemJS configuration (e.g., `map`, `paths`, `packages`) or a missing file.
fix
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.
TypeError: Cannot read properties of undefined (reading 'length')
This often occurs when the `routes` array in your `bundleConfig` is improperly formatted (e.g., not an array of strings) or when the `systemConfig` path is incorrect, preventing the bundler from correctly parsing input.
fix
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.
Upgrade
Version history
1.6.0latest on npm
Audit
Dependencies
systemjs-builderrequiredCore dependency for performing the actual SystemJS bundling and tracing operations.
Agent activity
11 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources