一覧へ戻る
SudoMaker/refurbish(新しいタブで開きます)
主要言語: JavaScript
rEFui HMR plugin for Rollup and Vite
- star 数
- 6
- watcher 数
- 0
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2025/11/22
主要言語: JavaScript
rEFui HMR plugin for Rollup and Vite
A Hot Module Replacement (HMR) plugin for rEFui components in Rollup, Vite, Webpack, and Rspack projects.
npm install refurbish # or pnpm i refurbish # or yarn add refurbish
Note: This plugin requires refui as a peer dependency.
npm install refui
# bunfig.toml [serve.static] plugins = ["refurbish/bun", ...other plugins]
// vite.config.js import { defineConfig } from 'vite'; import { refurbish } from 'refurbish/vite'; export default defineConfig({ plugins: [ refurbish(), // ... other plugins ], });
// rollup.config.js import { refurbish } from 'refurbish/rollup'; export default { plugins: [ refurbish(), // ... other plugins ], };
// webpack.config.js import { Refurbish } from 'refurbish/webpack'; export default { // ... plugins: [ new Refurbish(), // ... other plugins ], };
As Rspack is designed to be a drop-in replacement for Webpack, you can use refurbish/webpack directly in your Rspack configuration.
// rspack.config.js import { Refurbish } from 'refurbish/webpack'; export default { // ... plugins: [ new Refurbish(), // ... other plugins ], };
The plugin accepts an options object. The options are the same for Vite, Rollup, Webpack, and Rspack.
Vite / Rollup:
refurbish({ // File patterns to include (default: ['**/*.jsx', '**/*.tsx', '**/*.mdx']) include: ['**/*.jsx', '**/*.tsx'], // File patterns to exclude exclude: ['**/node_modules/**'], // Import source for HMR setup function (default: 'refui/hmr') importSource: 'refui/hmr', // Explicitly enable/disable the plugin. // Default: enabled in development, disabled in production. enabled: true })
Webpack / Rspack:
new Refurbish({ // File patterns to include (default: ['**/*.jsx', '**/*.tsx', '**/*.mdx']) include: ['**/*.jsx', '**/*.tsx'], // File patterns to exclude exclude: ['**/node_modules/**'], // Import source for HMR setup function (default: 'refui/hmr') importSource: 'refui/hmr', // Explicitly enable/disable the plugin. // Default: enabled in development, disabled in production. enabled: true })
include (string | string[]): Glob patterns for files to process. Defaults to JSX, TSX, and MDX files.exclude (string | string[]): Glob patterns for files to exclude from processing.importSource (string): The module path to import the HMR setup function from. Defaults to 'refui/hmr'.enabled (boolean): Explicitly enable or disable the plugin. If not set, the plugin is active only in development environments and is disabled for production builds.Apache License 2.0