hot-reload-optimizer
БесплатноБез исполняемых скриптовНе проверенOptimizes hot module replacement and fast refresh for development speed with Vite, Next.js, and webpack configurations. Use when users request "hot reload"…
от patricio0312rev★ 64 звезды на GitHubОб этом скилле
Hot Reload Optimizer
Optimize development experience with fast hot module replacement.
Core Workflow
- Analyze bottlenecks: Identify slow rebuilds
- Configure HMR: Framework-specific setup
- Optimize bundler: Exclude heavy dependencies
- Setup caching: Persistent caching
- Monitor performance: Dev server metrics
- Fine-tune: Incremental improvements
Vite Configuration
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [
react({
// Use SWC for faster transforms
jsxRuntime: 'automatic',
// Fast Refresh options
fastRefresh: true,
}),
tsconfigPaths(),
],
// Optimize dependencies
optimizeDeps: {
// Pre-bundle these dependencies
include: [
'react',
'react-dom',
'react-router-dom',
'@tanstack/react-query',
'zustand',
'lodash-es',
],
// Exclude from pre-bundling
exclude: ['@vite/client'],
// Force re-optimization
force: false,
// Increase timeout for slow deps
entries: ['./src/**/*.{ts,tsx}'],
},
// Server configuration
server: {
port: 3000,
// Enable HMR
hmr: {
overlay: true,
protocol: 'ws',
host: 'localhost',
},
// Watch options
watch: {
// Use polling in containers/VMs
usePolling: false,
// Ignore patterns
ignored: ['**/node_modules/**', '**/.git/**'],
},
// Faster startup
warmup: {
clientFiles: ['./src/main.tsx', './src/App.tsx'],
},
},
// Build optimizations for dev
build: {
// Source maps for development
sourcemap: true,
// Chunk size warnings
chunkSizeWarningLimit: 1000,
},
// Resolve configuration
resolve: {
alias: {
'@': '/src',
},
},
// CSS configuration
css: {
devSourcemap: true,
modules: {
localsConvention: 'camelCase',
},
},
// Define environment variables
define: {
__DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
},
});
Vite with SWC
// vite.config.ts with SWC
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
export default defineConfig({
plugins: [
react({
// SWC options
jsxImportSource: '@emotion/react',
plugins: [
// SWC plugins
['@swc/plugin-emotion', {}],
],
}),
],
});
Next.js Configuration
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
// Enable SWC compiler
swcMinify: true,
// Experimental features for faster dev
experimental: {
// Turbopack (when stable)
// turbo: {},
// Optimize package imports
optimizePackageImports: [
'@heroicons/react',
'lucide-react',
'date-fns',
'lodash',
],
},
// Webpack customization
webpack: (config, { dev, isServer }) => {
if (dev) {
// Faster source maps in development
config.devtool = 'eval-source-map';
// Ignore large modules in watch
config.watchOptions = {
ignored: ['**/node_modules/**', '**/.git/**'],
aggregateTimeout: 200,
poll: false,
};
// Cache configuration
config.cache = {
type: 'filesystem',
buildDependencies: {
config: [__filename],
},
};
}
return config;
},
// Disable type checking during dev (use IDE)
typescript: {
ignoreBuildErrors: process.env.NODE_ENV === 'development',
},
// Disable linting during dev (use IDE)
eslint: {
ignoreDuringBuilds: process.env.NODE_ENV === 'development',
},
// Image optimization
images: {
domains: ['example.com'],
deviceSizes: [640, 750, 828, 1080, 1200],
},
};
module.exports = nextConfig;
Next.js Turbopack
// next.config.js with Turbopack
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
resolveAlias: {
'@': './src',
},
},
},
};
module.exports = nextConfig;
# Run with Turbopack
next dev --turbo
Webpack Configuration
// webpack.config.js
const path = require('path');
const webpack = require('webpack');
const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = (env, argv) => {
const isDev = argv.mode === 'development';
return {
mode: isDev ? 'development' : 'production',
// Fast rebuild source maps
devtool: isDev ? 'eval-cheap-module-source-map' : 'source-map',
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: isDev ? '[name].
Установить hot-reload-optimizer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл hot-reload-optimizer?
Optimizes hot module replacement and fast refresh for development speed with Vite, Next.js, and webpack configurations. Use when users request "hot reload", "HMR optimization", "fast refresh", "dev server speed", or "development performance".
Как установить скилл hot-reload-optimizer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hot-reload-optimizer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic