Based on Umi to provide Rspack support and other best practices 为 Umi 提供 Rspack 支持
110
stars
55
commits
JavaScript
primary language
May 15, 2026
updated
Based on Umi to provide Rspack support and other best practices
English | 简体中文
Kmi provides Rspack support and modern web development best practices for UmiJS. It aims to provide faster and more efficient development experience with better build performance.
Kmi requires the latest Umi support. If your current Umi version is lower than
4.4.11, please upgradeumior@umijs/maxbefore proceeding.
npm init @kmijs/kmi@latest hello-kmi
hello-kmi is your project name, please specify according to your actual needsRun the pnpm dev command
pnpm dev
# Create a new Umi project
npx create-umi@latest my-rspack-app
cd my-rspack-app
# Install dependencies
pnpm install
Create or modify the .umirc.ts file in the project root directory:
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Other Umi configurations...
routes: [
{ path: '/', component: 'index' },
{ path: '/users', component: 'users' },
],
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Modify Webpack(Rspack) configuration object via bundler option
bundler: {
resolve: {
// Merged with built-in resolve.extensions
extensions: ['.web.tsx'],
}
}
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Modify Webpack(Rspack) configuration in function form
async bundler (config, { isProd }) {
// This is just an example
if (isProd) {
chain.devtool('source-map');
}
const { default: ESLintPlugin } = await import('eslint-webpack-plugin');
config.plugins?.push(new ESLintPlugin());
return config
}
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Through bundler you can get plugins that are compatible with both Webpack and Rspack
bundlerChain (config, { bundler }) {
// This is just an example
config.plugin('custom-define').use(bundler.DefinePlugin, [
{
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
},
]);
return config;
}
});
# Start the development server
pnpm dev
# Build the application
pnpm build
If you find this helpful, welcome to give us a star ⭐️⭐️⭐️
JavaScript
88.4%
TypeScript
10.9%
Based on Umi to provide Rspack support and other best practices 为 Umi 提供 Rspack 支持
110
stars
55
commits
JavaScript
primary language
May 15, 2026
updated
Based on Umi to provide Rspack support and other best practices
English | 简体中文
Kmi provides Rspack support and modern web development best practices for UmiJS. It aims to provide faster and more efficient development experience with better build performance.
Kmi requires the latest Umi support. If your current Umi version is lower than
4.4.11, please upgradeumior@umijs/maxbefore proceeding.
npm init @kmijs/kmi@latest hello-kmi
hello-kmi is your project name, please specify according to your actual needsRun the pnpm dev command
pnpm dev
# Create a new Umi project
npx create-umi@latest my-rspack-app
cd my-rspack-app
# Install dependencies
pnpm install
Create or modify the .umirc.ts file in the project root directory:
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Other Umi configurations...
routes: [
{ path: '/', component: 'index' },
{ path: '/users', component: 'users' },
],
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Modify Webpack(Rspack) configuration object via bundler option
bundler: {
resolve: {
// Merged with built-in resolve.extensions
extensions: ['.web.tsx'],
}
}
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Modify Webpack(Rspack) configuration in function form
async bundler (config, { isProd }) {
// This is just an example
if (isProd) {
chain.devtool('source-map');
}
const { default: ESLintPlugin } = await import('eslint-webpack-plugin');
config.plugins?.push(new ESLintPlugin());
return config
}
});
import { defineConfig } from 'umi';
export default defineConfig({
// Configure Kmi preset
presets: ['@kmijs/preset-bundler'],
// Enable Rspack
rspack: {},
// Through bundler you can get plugins that are compatible with both Webpack and Rspack
bundlerChain (config, { bundler }) {
// This is just an example
config.plugin('custom-define').use(bundler.DefinePlugin, [
{
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
},
]);
return config;
}
});
# Start the development server
pnpm dev
# Build the application
pnpm build
If you find this helpful, welcome to give us a star ⭐️⭐️⭐️
JavaScript
88.4%
TypeScript
10.9%