App Bundler

0.2.18 · abandoned · verified Tue Apr 21

The `app-bundler` package is a JavaScript application bundler designed to support multiple module systems including CommonJS, MaskJS, IncludeJS, and AMD. Its core philosophy emphasizes a "no dependency" approach for the development process, aiming to be run only for deployments, and requires minimal configuration, often just a few lines in `package.json`. It focuses on single responsibility – combining modules into JS, CSS, and HTML bundles – and decouples pre- and post-processing through `atma-io` middlewares. This design allows for flexible integration with various preprocessors like TypeScript, Babel, Less, and Sass by utilizing `atma-io` plugins for file loading and transformation. The package is currently at version 0.2.18, and its GitHub repository shows no active development or commits for over six years as of 2026. Consequently, `app-bundler` is considered an abandoned project and is not recommended for new development or actively maintained systems due to potential security vulnerabilities, lack of compatibility with modern JavaScript ecosystems, and absence of community support. Developers should opt for contemporary, actively maintained bundling solutions.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to invoke `app-bundler` using both its command-line interface via `npx` for a `package.json` script and a programmatic approach using its exported `bundle` function for a CommonJS application.

/* package.json example for basic CLI bundling:
"scripts": {
  "build": "app-bundler --entry src/main.js --output dist/app.bundle.js"
}
*/

// CLI Usage Example (run in your project's root):
// npx app-bundler --entry src/main.js --output dist/app.bundle.js

// Programmatic Usage Example:
const { bundle } = require('app-bundler');
const path = require('path');
const fs = require('fs');

async function buildApplication() {
  const sourceDirectory = path.resolve(__dirname, 'src');
  const outputDirectory = path.resolve(__dirname, 'dist');
  const entryFilePath = path.join(sourceDirectory, 'main.js');
  const outputFilePath = path.join(outputDirectory, 'app.bundle.js');

  // Ensure the output directory exists
  if (!fs.existsSync(outputDirectory)) {
    fs.mkdirSync(outputDirectory, { recursive: true });
  }

  try {
    console.log('Starting application bundling with app-bundler...');
    // The `bundle` function's exact API is not explicitly detailed in the README.
    // Based on CLI arguments, a simple object might be accepted.
    // For production, refer to the source code for precise options.
    await bundle({
      input: entryFilePath,
      output: outputFilePath,
      type: 'commonjs' // Specify the module type, e.g., 'commonjs', 'amd', 'maskjs'
      // Other options might include 'includejsPaths' or preprocessor configurations
    });
    console.log(`Bundling completed successfully to: ${outputFilePath}`);
  } catch (error) {
    console.error('Application bundling failed:', error);
    process.exit(1);
  }
}

// Uncomment to run the programmatic build (e.g., as part of a custom build script)
// buildApplication();

view raw JSON →