{"library":"rollup-plugin-preprocess","title":"rollup-plugin-preprocess","description":"A Rollup plugin that integrates the Preprocess library to conditionally include or exclude parts of files (HTML, JS, etc.) based on a user-defined context (e.g., DEBUG flags). The latest stable version is 0.0.4 (released November 2016). Development appears to be stalled with no recent releases or maintenance; this plugin is a thin wrapper around the `preprocess` package for Rollup build pipelines. Alternatives include `@rollup/plugin-replace` or direct use of `preprocess` with other Rollup hooks. The plugin supports simple context-based preprocessing but lacks extensive documentation and has limited adoption.","language":"javascript","status":"deprecated","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-preprocess"],"cli":null},"imports":["import preprocess from 'rollup-plugin-preprocess'","import RollupPluginPreprocess from 'rollup-plugin-preprocess'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport preprocess from 'rollup-plugin-preprocess';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife'\n  },\n  plugins: [\n    preprocess({\n      context: {\n        DEBUG: process.env.DEBUG === 'true',\n        VERSION: '1.0.0'\n      }\n    })\n  ]\n};\n\n// In your source code:\n// @if DEBUG\nconsole.log('Debug mode');\n// @endif\n// @echo VERSION","lang":"javascript","description":"Shows how to configure the plugin with a context object and use preprocess directives in source files.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}