snowpack-plugin-rollup-bundle is a Snowpack plugin designed to integrate Rollup for production bundling of web applications. The package, currently at version 0.4.4, provides functionality to process specified entrypoints (relative to the Snowpack `build/` directory), bundling them along with their corresponding CSS files and generating a `manifest.json` for hashed asset locations. It was initially developed with a focus on seamless integration with Rails applications, particularly through the `Snowpacker` gem. While it fulfills its purpose for Snowpack projects, it's important to note that Snowpack itself has largely been unmaintained since 2021, with its creators now recommending alternatives like Vite for new development. Consequently, this plugin is primarily relevant for maintaining or optimizing existing Snowpack-based projects rather than serving new build tooling initiatives.
npm install snowpack-plugin-rollup-bundleVerified import paths — ran on the pinned version, not inferred.
This quickstart shows a typical `snowpack.config.js` setup for `snowpack-plugin-rollup-bundle`, demonstrating how to enable HTML file rewriting, specify entrypoints, and extend the underlying Rollup configuration with custom plugins or options.
Update your Snowpack configuration to use `emitHtmlFiles: true` instead of `emitHtml: true`.
Ensure all `entrypoints` paths provided in the plugin configuration correctly reference files within the `build/` output directory, typically `build/_dist_/`.
Run `npm install --save-dev rollup snowpack` or `yarn add --dev rollup snowpack` to install the peer dependencies.
For new projects, consider modern build tools like Vite. For existing projects, be aware of the limited ongoing support for the Snowpack ecosystem.
Upgrade to `v0.4.4` or later to ensure proper functionality on Windows.
Install Rollup: `npm install --save-dev rollup` or `yarn add --dev rollup`.
Adjust the `entrypoints` in your `snowpack.config.js` to point to the built files, e.g., `"build/_dist_/index.js"`.
Initialize the `plugins` array if it doesn't exist before pushing to it: `config.inputOptions.plugins = config.inputOptions.plugins || []; config.inputOptions.plugins.push(yourPlugin());`