0.1.8 • Published 11 months ago

@react-scan/vite-plugin-react-scan v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@react-scan/vite-plugin-react-scan

A Vite plugin that integrates React Scan into your Vite application, automatically detecting performance issues in your React components.

Installation

# npm
npm install -D @react-scan/vite-plugin-react-scan react-scan

# pnpm
pnpm add -D @react-scan/vite-plugin-react-scan react-scan

# yarn
yarn add -D @react-scan/vite-plugin-react-scan react-scan

Note: Make sure react-scan is installed as a peer dependency. The plugin will automatically locate it in your project's dependency tree.

Usage

Add the plugin to your vite.config.ts:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import reactScan from '@react-scan/vite-plugin-react-scan';

export default defineConfig({
  plugins: [
    react(),
    reactScan({
      // options (optional)
    }),
  ],
});

Options

OptionTypeDefaultDescription
enablebooleanprocess.env.NODE_ENV === 'development'Enable/disable scanning
scanOptionsobject{ ... }Custom React Scan options
autoDisplayNamesbooleanfalseAutomatically add display names to React components
debugbooleanfalseEnable debug logging

Example Configuration

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import reactScan from '@react-scan/vite-plugin-react-scan';

export default defineConfig({
  plugins: [
    react(),
    reactScan({
      enable: true,
      autoDisplayNames: true,
      scanOptions: {} // React Scan specific options
    }),
  ],
});

Development vs Production

  • In development: The plugin injects React Scan directly into your application for real-time analysis
  • In production: The plugin can be disabled/enabled by default with specific options

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

React Scan Vite Plugin is MIT-licensed open-source software by Aiden Bai, Million Software, Inc., and contributors.

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.4-rc.3

11 months ago

0.1.4-rc.2

11 months ago

0.1.4-rc.1

11 months ago

0.1.3

12 months ago

0.1.3-rc.3

12 months ago

0.1.3-rc.2

12 months ago

0.1.3-rc.1

12 months ago

0.1.2-rc.3

12 months ago

0.1.2-rc.2

12 months ago

0.1.2-rc.1

12 months ago

0.1.2

12 months ago

0.1.1-rc.1

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago

0.1.0-rc.2

12 months ago

0.1.0-rc.1

12 months ago