Skip to content

Commit f5af629

Browse files
committed
improve: vite-plugin-react-scan readme and error message
1 parent 5f63037 commit f5af629

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/vite-plugin-react-scan/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pnpm add -D @react-scan/vite-plugin-react-scan react-scan
1515
yarn add -D @react-scan/vite-plugin-react-scan react-scan
1616
```
1717

18+
> **Note:** Make sure `react-scan` is installed as a peer dependency. The plugin will automatically locate it in your project's dependency tree.
19+
1820
## Usage
1921

2022
Add the plugin to your `vite.config.ts`:

packages/vite-plugin-react-scan/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ const reactScanPlugin = (options: ReactScanPluginOptions = {}): Plugin => {
293293
log.debug('Emitted react-scan as asset:', assetFileName);
294294
} catch (error) {
295295
log.error('Failed to process react-scan:', error);
296+
throw new Error(
297+
`Module ${REACT_SCAN_IDENTIFIER} not found. Please ensure react-scan is installed as a peer dependency.`
298+
);
296299
}
297300
}
298301
},

0 commit comments

Comments
 (0)