{"library":"rollup-plugin-preact","title":"rollup-plugin-preact","description":"Rollup plugin that automatically resolves and aliases React imports to Preact/Preact Compat in Rollup bundles. Current stable version 0.5.2. Configurable options include usePreactX for Preact X, noPropTypes, noReactIs, noEnv flags to remove unnecessary compat code, and custom aliasModules. It simplifies migrating from React to Preact by handling module resolution and compat aliasing.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-preact"],"cli":null},"imports":["import preact from 'rollup-plugin-preact'","const preact = require('rollup-plugin-preact')","import preact from 'rollup-plugin-preact';\nexport default { plugins: [preact({ usePreactX: true })] }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport preact from 'rollup-plugin-preact';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n  },\n  plugins: [\n    preact({\n      usePreactX: true,\n      noPropTypes: true,\n      noReactIs: true,\n      noEnv: true,\n      resolvePreactCompat: true,\n      aliasModules: {\n        'react-dom': 'preact/compat',\n      },\n    }),\n  ],\n};","lang":"javascript","description":"Configure Rollup to replace React imports with Preact/Preact Compat and remove unnecessary compat code.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}