{"id":18695,"library":"pundle-middleware","title":"Pundle Middleware","description":"Express middleware for Pundle, a JavaScript bundler. Provides development server integration with Express, enabling features like HMR and file serving. The package is part of the Pundle ecosystem, which is an alternative to Webpack. As of version 1.0.0 (stable), it is designed for advanced users. The v2.0.0-alpha1 release includes breaking changes with a complete architecture rebuild. Release cadence is sporadic with major gaps between versions. Differentiators: tight integration with Pundle's modular component system and presets.","status":"active","version":"0.2.15","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/motion/pundle","tags":["javascript"],"install":[{"cmd":"npm install pundle-middleware","lang":"bash","label":"npm"},{"cmd":"yarn add pundle-middleware","lang":"bash","label":"yarn"},{"cmd":"pnpm add pundle-middleware","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler required for middleware to function","package":"pundle","optional":false},{"reason":"Peer dependency for Express integration","package":"express","optional":false}],"imports":[{"note":"Package is ESM-only from v1.0.0; no CommonJS export.","wrong":"const pundleMiddleware = require('pundle-middleware')","symbol":"default","correct":"import pundleMiddleware from 'pundle-middleware'"},{"note":"The named export exists but is not documented; use default import for reliability.","wrong":"import { createMiddleware } from 'pundle-middleware'","symbol":"createMiddleware","correct":"import { createMiddleware } from 'pundle-middleware'"},{"note":"Type import only; not a runtime value. Available in TypeScript.","wrong":"import { PundleMiddlewareOptions } from 'pundle-middleware'","symbol":"PundleMiddlewareOptions","correct":"import type { PundleMiddlewareOptions } from 'pundle-middleware'"}],"quickstart":{"code":"import express from 'express';\nimport pundleMiddleware from 'pundle-middleware';\nimport { createPundle } from 'pundle';\n\nconst app = express();\nconst pundle = createPundle({\n  entry: './src/index.js',\n  output: { format: 'esm', dir: './dist' },\n});\n\napp.use(pundleMiddleware(pundle, {\n  hmr: true,\n  watch: true,\n}));\n\napp.listen(3000);","lang":"typescript","description":"Shows how to integrate Pundle middleware with Express for HMR and file watching."},"warnings":[{"fix":"Check changelog for migration guide; use v1.x if stable required.","message":"v2.0.0-alpha1 completely rebuilt; API is incompatible with v1.x","severity":"breaking","affected_versions":">=2.0.0-alpha1 <2.0.0"},{"fix":"Use default import to ensure compatibility.","message":"Named export createMiddleware may be deprecated in favor of default export","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use import or configure CommonJS interop.","message":"Package is ESM-only; using require() will throw Error [ERR_REQUIRE_ESM]","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Switch to import syntax or use dynamic import().","cause":"Using CommonJS require with ESM-only package","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Run: npm install pundle","cause":"Pundle core not installed as dependency","error":"Cannot find module 'pundle'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}