{"library":"rollup-plugin-your-function","title":"rollup-plugin-your-function","description":"A Rollup plugin that accepts a user-defined function to manipulate build output. Version 0.5.3, stable with occasional updates. Provides a minimal API for custom source transformations without learning plugin-specific DSLs. Unlike replace, string-replace, or regex plugins, it allows arbitrary JavaScript logic including async operations, conditional transformations based on file ID, and custom sourcemap generation. Supports both build and output plugin modes with include/exclude minimatch filtering. No external dependencies beyond Rollup peer.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-your-function"],"cli":null},"imports":["import { yourFunction } from 'rollup-plugin-your-function'","const myPlugin = yourFunction({ output: true, name: 'myPlugin', fn: ... }); then use myPlugin() in output.plugins","yourFunction({ fn: (source) => { return code; } })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport { yourFunction } from 'rollup-plugin-your-function';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    yourFunction({\n      include: '**/*.js',\n      exclude: 'node_modules/**',\n      fn: (source, options) => {\n        // Replace 'console.log' with 'console.info'\n        let code = source.replace(/console\\.log/g, 'console.info');\n        // Append a comment\n        code += '\\n// Transformed by rollup-plugin-your-function';\n        return code;\n      }\n    })\n  ]\n};\n\n// Then run: rollup -c","lang":"javascript","description":"Basic usage: transform build files by replacing console.log calls and appending a comment using a custom function.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}