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.
npm install rollup-plugin-preactVerified import paths — ran on the pinned version, not inferred.
Configure Rollup to replace React imports with Preact/Preact Compat and remove unnecessary compat code.
Upgrade Node to >=10 and Rollup to >=1.0.
Replace 'usePreactX: true' with 'resolvePreactCompat: true'.
Run 'npm install preact' and use 'aliasModules: { "react": "preact/compat" }'.Remove PropTypes imports or set 'noPropTypes: false' if needed.
Run 'npm install rollup-plugin-preact' or 'yarn add rollup-plugin-preact'.
Use 'import preact from "rollup-plugin-preact"' or 'const preact = require("rollup-plugin-preact")'.Install preact-compat or set alias properly, e.g., 'aliasModules: { "react": "preact/compat" }'.No dependency data recorded yet.