Pallet Bundler
raw JSON → 1.0.12 verified Sat Apr 25 auth: no javascript
Pallet is a zero-config JavaScript bundler that processes an HTML entry point and automatically bundles linked JS and CSS into separate files. Version 1.0.12 is the latest stable release with infrequent updates. It offers a simple CLI with options for entry, output directory, and file naming, plus a config file for customization. Unlike webpack or Parcel, Pallet focuses on minimal setup and HTML-first bundling, making it suitable for small static sites or prototyping.
Common errors
error Error: Cannot find module 'pallet-bundler' ↓
cause Package not installed globally.
fix
Install globally: npm install -g pallet-bundler
error Error: ENOENT: no such file or directory, open 'index.html' ↓
cause Entry point missing or wrong path.
fix
Create index.html or specify correct entry with -e.
error TypeError: Cannot read property 'split' of undefined ↓
cause Config file has invalid syntax.
fix
Ensure pallet.config.js exports a valid object.
Warnings
gotcha Config file must be named pallet.config.js and use CommonJS module.exports. ↓
fix Use module.exports instead of export default.
gotcha All linked assets in HTML are bundled; external URLs may be inlined or ignored. ↓
fix Ensure all local references are relative and correct.
gotcha Output directory is created if not exists, but may overwrite existing files without warning. ↓
fix Backup your dist folder or use a different output dir.
breaking Entry point is index.html by default; if missing, the bundler throws an error. ↓
fix Specify entry with -e flag or ensure index.html exists.
Install
npm install pallet-bundler yarn add pallet-bundler pnpm add pallet-bundler Imports
- pallet bundler wrong
const pallet = require('pallet-bundler')correctimport { bundle } from 'pallet-bundler' - Pallet CLI wrong
npm run palletcorrectnpx pallet - Config file wrong
export default { ... }correctmodule.exports = { ... }
Quickstart
mkdir my-project && cd my-project
echo '<html><head><link rel="stylesheet" href="style.css"></head><body><script src="script.js"></script></body></html>' > index.html
echo 'body { background: red; }' > style.css
echo 'console.log("hello");' > script.js
npm install -g pallet-bundler
pallet -e index.html -d dist
ls dist/