netpack-rollup

raw JSON →
1.0.40 verified Mon Apr 27 auth: no javascript maintenance

NetPack-rollup is a host module that integrates Rollup as a bundler within the NetPack build pipeline, leveraging Microsoft.AspNetCore.NodeServices for ASP.NET Core interoperability. Current version 1.0.40 is stable but sees no active development. It is a niche tool for ASP.NET Core projects that need Rollup bundling, with TypeScript source and transpiled JavaScript output. Differentiators: tight coupling with .NET ecosystem, unlike standalone Rollup wrappers.

error Error: Cannot find module 'rollup'
cause Rollup is not installed as a peer dependency.
fix
npm install rollup@^1.0.0 --save-dev
error TypeError: Cannot read property 'bundle' of undefined
cause Host creation failed due to missing or invalid NodeServices.
fix
Ensure NodeServices is properly configured and passed to createRollupHost.
error Error: rollupConfig is required
cause Missing rollupConfig in the options object.
fix
Provide a valid rollupConfig object with 'input' and 'output' properties.
gotcha Requires specific version of rollup (^1.0.0) - incompatible with newer rollup versions.
fix Pin rollup to version 1.x or use an alternative bundler host.
gotcha Depends on deprecated Microsoft.AspNetCore.NodeServices package; may not work with .NET 5+.
fix Consider migrating to JavaScriptServices alternatives or using a different approach.
deprecated Package has not been updated in 3+ years; consider it in maintenance mode.
fix Evaluate if the functionality is still needed and look for modern replacements.
gotcha NodeServices initialization is required and must be passed in options; missing will cause runtime errors.
fix Always provide a valid NodeServices instance in the host configuration.
npm install netpack-rollup
yarn add netpack-rollup
pnpm add netpack-rollup

Shows how to create a Rollup host instance with required configuration and invoke bundling.

import { createRollupHost } from 'netpack-rollup';

const host = createRollupHost({
  rollupConfig: {
    input: 'src/index.js',
    output: { dir: 'dist', format: 'esm' }
  },
  nodeServices: {
    options: { /* Add NodeServices options */ }
  }
});

host.bundle().then(() => console.log('Bundle complete')).catch(err => console.error(err));