Serve a Rollup-bundled JavaScript file directly from an Express.js endpoint with minimal configuration. Current stable version is 0.2.2. It builds bundles on the fly during development and enables caching with gzip in production via the NODE_ENV environment variable. Differentiators include zero build step integration, automatic caching, and support for all Rollup options including plugins and generate options. Ideal for rapid prototyping or simple SPAs without a separate build system.
npm install rollup-endpointVerified import paths — ran on the pinned version, not inferred.
Creates an Express server that serves a Rollup-bundled JavaScript file from client/main.js, with production plugins for transpilation and minification.
Ensure NODE_ENV=production in production environments. For development, consider using nodemon or similar to restart automatically on changes.
Use 'es' for ES module format instead of 'es6'.
Create a new plugin instance for each request by using a factory function, or ensure plugins are stateless.
Pin Rollup to version 1.x (e.g., "rollup": "^1.0.0") or update to a compatible package.
Use 'input' instead of 'entry' when specifying the bundle entry point.
Run: npm install rollup --save
Use: const rollupEndPoint = require('rollup-endpoint'); app.get('/bundle.js', rollupEndPoint.serve({...}));Use import syntax or rename file to .cjs to force CommonJS.
Replace 'entry' with 'input' in the options object.