jex-bundler

raw JSON →
1.1.6 verified Sat Apr 25 auth: no javascript

jex-bundler is a lightweight JavaScript bundler for small to medium-sized projects, version 1.1.6. It aims to simplify the bundling process with minimal configuration. The release cadence is unknown. Differentiators include simplicity and ease of use, but it lacks advanced features like code splitting or plugin systems found in larger bundlers.

error Error: Cannot find module 'jex-bundler'
cause Module not installed or misspelled name.
fix
Run 'npm install jex-bundler' in your project root.
error TypeError: bundle is not a function
cause Importing incorrectly, e.g., default import instead of named import.
fix
Use 'import { bundle } from 'jex-bundler''.
error Error: The output path must be absolute
cause Output option provided as a relative path.
fix
Provide an absolute path using path.resolve or path.join.
gotcha The bundle function expects an absolute path for the output option. Relative paths cause unexpected behavior.
fix Use path.resolve or join with process.cwd() to provide absolute path.
gotcha Input files must have a .mjs or .js extension; .ts files are not supported without a separate TypeScript compiler step.
fix Pre-compile TypeScript to JavaScript before bundling.
gotcha The bundle function returns a promise; failing to await it may lead to incomplete builds.
fix Always await or .then() the promise returned by bundle().
npm install jex-bundler
yarn add jex-bundler
pnpm add jex-bundler

Builds a JavaScript bundle from entry to output directory using ESM format.

import { bundle } from 'jex-bundler';
import { join } from 'path';

const build = async () => {
  try {
    const result = await bundle({
      entry: './src/index.js',
      output: join(process.cwd(), 'dist'),
      format: 'esm',
    });
    console.log('Build complete:', result.fileName);
  } catch (error) {
    console.error('Build failed:', error);
  }
};

build();