{"library":"snowpack-plugin-rollup-bundle","title":"Snowpack Rollup Bundling Plugin","type":"library","description":"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.","language":"javascript","status":"maintenance","last_verified":"Tue Apr 21","install":{"commands":["npm install snowpack-plugin-rollup-bundle"],"cli":null},"imports":["// snowpack.config.js\nmodule.exports = {\n  plugins: [\n    ['snowpack-plugin-rollup-bundle', { /* options */ }]\n  ]\n};","const awesomeRollupPlugin = require('awesome-rollup-plugin');","const plugins = [\n  // ...\n  [\"snowpack-plugin-rollup-bundle\", { /* options */ }]\n];\nmodule.exports = {\n  plugins: plugins\n};"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/snowpack-plugin-rollup-bundle","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"// snowpack.config.js\nconst awesomeRollupPlugin = require('awesome-rollup-plugin'); // Example for extending config\n\nmodule.exports = {\n  mount: {\n    'src': '/',\n  },\n  plugins: [\n    // Other Snowpack plugins...\n    [\n      \"snowpack-plugin-rollup-bundle\",\n      {\n        emitHtmlFiles: true, // Set to true to rewrite script tags in HTML\n        preserveSourceFiles: false,\n        entrypoints: [\n          \"build/_dist_/index.js\",\n          \"build/_dist_/entrypoints/*.js\",\n        ], // Required: glob patterns or array of paths relative to build/\n        extendConfig: (config) => {\n          // Example: Add a custom Rollup plugin\n          config.inputOptions.plugins.push(awesomeRollupPlugin());\n          // Example: Override output options\n          config.outputOptions = {\n            ...config.outputOptions,\n            chunkFileNames: 'chunks/[name]-[hash].js',\n            assetFileNames: 'assets/[name]-[hash][extname]'\n          };\n          return config;\n        }\n      }\n    ]\n  ],\n  build: {\n    out: 'dist',\n    metaDir: '_snowpack_',\n  },\n  optimize: {\n    bundle: false, // Ensure Snowpack's built-in bundler is off if using this plugin\n  },\n};\n","lang":"javascript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}