{"id":15514,"library":"app-bundler","title":"App Bundler","description":"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.","status":"abandoned","version":"0.2.18","language":"javascript","source_language":"en","source_url":"https://github.com/atmajs/app-bundler","tags":["javascript","module","commonjs","includejs","bundle","build","package","compiler"],"install":[{"cmd":"npm install app-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add app-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add app-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for file loading, saving, and middleware integration for pre/post-processing, enabling support for various file types and preprocessors.","package":"atma-io","optional":false}],"imports":[{"note":"This package is CommonJS-first. Its primary programmatic API is the `bundle` function, exposed via `module.exports`. ESM `import` syntax is not directly supported without a CJS wrapper or transpilation.","wrong":"import { bundle } from 'app-bundler';","symbol":"bundle","correct":"const { bundle } = require('app-bundler');"},{"note":"The `bin/app-bundler` script is designed for command-line interface (CLI) execution via `npx` or a `package.json` script. Direct `require()` calls to the binary script are not intended for programmatic use and will bypass its CLI argument parsing and environment setup.","wrong":"const cli = require('app-bundler/bin/app-bundler');","symbol":"CLI Execution (via child process)","correct":"const { execSync } = require('child_process');\nexecSync('npx app-bundler --version', { stdio: 'inherit' });"},{"note":"While it's technically possible to `require` internal modules like `lib/bundler.js` directly, this is generally discouraged. Internal paths are not part of the public API contract and may change in future (though unlikely for an abandoned project) without notice. Always prefer the top-level package import.","wrong":"const bundlerModule = require('app-bundler/lib/bundler');\nconst bundle = bundlerModule.bundle;","symbol":"Internal `bundle` module (discouraged)","correct":"const { bundle } = require('app-bundler/lib/bundler');"}],"quickstart":{"code":"/* package.json example for basic CLI bundling:\n\"scripts\": {\n  \"build\": \"app-bundler --entry src/main.js --output dist/app.bundle.js\"\n}\n*/\n\n// CLI Usage Example (run in your project's root):\n// npx app-bundler --entry src/main.js --output dist/app.bundle.js\n\n// Programmatic Usage Example:\nconst { bundle } = require('app-bundler');\nconst path = require('path');\nconst fs = require('fs');\n\nasync function buildApplication() {\n  const sourceDirectory = path.resolve(__dirname, 'src');\n  const outputDirectory = path.resolve(__dirname, 'dist');\n  const entryFilePath = path.join(sourceDirectory, 'main.js');\n  const outputFilePath = path.join(outputDirectory, 'app.bundle.js');\n\n  // Ensure the output directory exists\n  if (!fs.existsSync(outputDirectory)) {\n    fs.mkdirSync(outputDirectory, { recursive: true });\n  }\n\n  try {\n    console.log('Starting application bundling with app-bundler...');\n    // The `bundle` function's exact API is not explicitly detailed in the README.\n    // Based on CLI arguments, a simple object might be accepted.\n    // For production, refer to the source code for precise options.\n    await bundle({\n      input: entryFilePath,\n      output: outputFilePath,\n      type: 'commonjs' // Specify the module type, e.g., 'commonjs', 'amd', 'maskjs'\n      // Other options might include 'includejsPaths' or preprocessor configurations\n    });\n    console.log(`Bundling completed successfully to: ${outputFilePath}`);\n  } catch (error) {\n    console.error('Application bundling failed:', error);\n    process.exit(1);\n  }\n}\n\n// Uncomment to run the programmatic build (e.g., as part of a custom build script)\n// buildApplication();","lang":"javascript","description":"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."},"warnings":[{"fix":"Migrate to actively maintained, modern bundlers like Webpack, Rollup, Vite, or Parcel. If migration is not immediately feasible for legacy projects, understand the security and compatibility risks.","message":"This package is effectively abandoned, with no significant updates or commits in over 6 years (as of 2026). It is not recommended for new projects and carries risks for existing ones due to lack of security patches, modern feature support, and community maintenance.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"For projects using ESM, configure a transpilation middleware (e.g., Babel via `atma-io` plugins) to convert ESM to CJS before `app-bundler` processes the files, or rewrite modules to use CommonJS `require()` syntax. Alternatively, use a modern bundler with native ESM support.","message":"`app-bundler` is designed for CommonJS and older web module systems (MaskJS, IncludeJS, AMD). It does not natively understand or process modern ES Modules (ESM) syntax without an external `atma-io` middleware for transpilation, requiring manual setup.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"For sophisticated build requirements, be prepared to develop custom `atma-io` plugins or to orchestrate `app-bundler` within a larger, multi-tool build pipeline. Assess if a more feature-rich, opinionated bundler might be more suitable for your project's needs.","message":"The project emphasizes \"no configuration\" and \"decoupled pre- and post-processing.\" This means advanced build features like automatic code splitting, elaborate asset optimization, or complex plugin ecosystems are not built-in to `app-bundler` itself. These require custom `atma-io` middleware development or integration with other build tools.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure `atma-io` is listed in your project's `dependencies` or `devDependencies` and run `npm install` or `yarn install` to properly install it.","cause":"`atma-io` is a required peer dependency for `app-bundler`'s file handling and middleware system, but it has not been installed or cannot be resolved by Node.js.","error":"Error: Cannot find module 'atma-io' from '[path-to-your-project]'"},{"fix":"Install and configure an `atma-io` plugin that handles JavaScript transpilation (e.g., integrating Babel) to convert ES Modules to CommonJS. Alternatively, ensure all source files use CommonJS `require()` and `module.exports` syntax.","cause":"`app-bundler` encounters modern ES Module syntax (`import`/`export`) in your source files but does not have a configured `atma-io` middleware to transpile it to a compatible format (like CommonJS).","error":"SyntaxError: Unexpected token 'export' (or 'import')"},{"fix":"Verify and adjust the file system permissions for the output directory. On Unix-like systems, ensure the user has write access. If running as a build script, check the environment permissions. As a temporary measure, `sudo npx app-bundler` might work for CLI usage, but is not recommended for automated builds.","cause":"The user account or process running `app-bundler` lacks the necessary write permissions for the specified output directory or file.","error":"Error: EACCES: permission denied, open '[output-file-path]'"}],"ecosystem":"npm"}