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.
Common errors
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.
Warnings
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().
Install
npm install jex-bundler yarn add jex-bundler pnpm add jex-bundler Imports
- default wrong
const jex = require('jex-bundler')correctimport jex from 'jex-bundler' - bundle wrong
import bundle from 'jex-bundler'correctimport { bundle } from 'jex-bundler' - JexConfig
import type { JexConfig } from 'jex-bundler'
Quickstart
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();