123456789101112131415161718192021222324252627282930313233 |
- const { pluginReact } = require('@rsbuild/plugin-react');
- const createEslintPlugin = require('./plugins/eslint');
- const baseConfig = require('./base');
- const { mergeRsbuildConfig } = require('@rsbuild/core');
- /**
- * React 应用的 Rsbuild 配置
- */
- const reactConfig = {
- plugins: [
- pluginReact({
- // React 插件配置
- fastRefresh: true,
- }),
- createEslintPlugin(),
- ],
- source: {
- // 默认入口配置
- entry: {
- index: './src/index',
- },
- // 默认支持的文件扩展名
- extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
- },
- dev: {
- // 开发服务器配置
- port: 3000,
- open: true,
- },
- };
- // 合并基础配置和 React 配置
- module.exports = mergeRsbuildConfig(baseConfig, reactConfig);
|