Paquet

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

Paquet is a simple JavaScript module bundler that supports both ESM `import` and CommonJS `require` statements, and bundles `node_modules` as well. As of version 0.0.2, it is in early development with limited features. It offers a CLI interface for quick bundling and supports a configuration file (`paquet.config.js`), environment variable injection, and mutator functions for code transformation before or after ES6-to-ES5 transpilation. Plugins are planned but not yet implemented. Suitable for small projects or learning, it is not production-ready.

error Error: Cannot find module 'paquet'
cause Paquet is not installed or not in PATH.
fix
Install globally: npm install -g paquet-bundler, or use npx: npx paquet --entry ...
error SyntaxError: Unexpected token 'export'
cause Paquet may not fully support ESM export syntax in all cases or requires a specific entry format.
fix
Ensure entry file uses CommonJS or check version for ESM support; transpile ESM to CJS via Babel first.
gotcha Paquet is in early development (v0.0.2) and not production-ready. Features may be incomplete or unstable.
fix Review source code for stability; consider using well-established bundlers (Webpack, Rollup, esbuild) for production.
gotcha Plugins are listed in configuration but not yet implemented. Any plugin configuration will be ignored.
fix Do not rely on plugins; use mutators for code transformations instead.
gotcha The 'env' option must be passed as a JSON string or object; incorrect formatting may cause errors or silently fail.
fix Ensure --env is a valid JSON object, e.g., --env { KEY: 'value' }
gotcha No TypeScript support; bundling .ts files will not work out of the box.
fix Transpile TypeScript to JavaScript before bundling with Paquet, or use a different bundler.
npm install paquet-bundler
yarn add paquet-bundler
pnpm add paquet-bundler

Shows basic CLI usage: bundle a simple entry file to an output file.

// Create entry file src/index.js
console.log('Hello from Paquet!');

// In terminal, run:
// npx paquet --entry src/index.js --out dist/bundle.js

// Output dist/bundle.js will contain the bundled code.