{"id":14174735,"url":"https://github.com/atom-yang/aumi","last_synced_at":"2025-08-07T04:32:10.875Z","repository":{"id":252625450,"uuid":"840973328","full_name":"atom-yang/aumi","owner":"atom-yang","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-10T11:23:34.000Z","size":428,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-10T12:53:25.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atom-yang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-11T09:05:39.000Z","updated_at":"2024-09-10T11:23:38.000Z","dependencies_parsed_at":"2024-08-18T03:01:28.794Z","dependency_job_id":null,"html_url":"https://github.com/atom-yang/aumi","commit_stats":null,"previous_names":["atom-yang/rumi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-yang%2Faumi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-yang%2Faumi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-yang%2Faumi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom-yang%2Faumi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atom-yang","download_url":"https://codeload.github.com/atom-yang/aumi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228994815,"owners_count":18003452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-18T03:00:31.371Z","updated_at":"2024-12-10T02:30:42.232Z","avatar_url":"https://github.com/atom-yang.png","language":"TypeScript","readme":"# AUmi\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/@aumi/aumi\"\u003e\n   \u003cimg src=\"https://img.shields.io/npm/v/@aumi/aumi?style=flat-square\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nBuild Umi based on Rsbuild\n\nEnglish | [简体中文](./README.zh-CN.md)\n\nAUmi switches Umi's default bundler from Webpack to [Rsbuild](https://rsbuild.dev/zh/)\n\n## Features\n\n* [10x performance improvement](https://rsbuild.dev/zh/guide/start/index#-%E6%80%A7%E8%83%BD);\n* Retain Umi plugin system and the same user experience;\n* Migration Umi project in 5 minutes.\n\n## Migration\n\n**Notice: Make sure your Umi version is \u003e= 4.0**\n\n**Notice: V**\n\n### Installation\n\n```bash\nnpm add @aumi/aumi@latest -S\n```\n\n### File changes\n\n#### Updating `.umirc.ts` :\n\n```diff title=\".umirc.ts\"\n- import { defineConfig } from 'umi';\n+ import {defineAUMIConfig} from \"@aumi/aumi\";\n\n- export default defineConfig({\n+ export default defineAUMIConfig({\n  ...,\n});\n```\n\nDue to compatibility or lacking of testing, cannot support the following configurations.\n\n| Field                | Unsupported Reason                                                                                                   | Replacement method                                                                                                                                  |\n| :------------------- | :------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- |\n| autoprefixer         | Use another approach                                                                                                 | 1. use browserlist\u003cbr/\u003e2. `targets` configuration of `.umirc.ts`                                                                                    |\n| cssMinifier          | Use another approach                                                                                                 | `minify` configuration of `.umirc.ts`                                                                                                               |\n| classPropertiesLoose | This is a babel configuration in Umi, Rsbuild uses swc by default                                                    | `swcLoader` configuration of `.umirc.ts`                                                                                                            |\n| deadCode             | Webpack plugin, rspack compatibility is no tested                                                                    | None                                                                                                                                                |\n| depTranspiler        | Not used in `@umijs/bundler-webpack`                                                                                 | None                                                                                                                                                |\n| esbuildMinifyIIFE    | Fix the namespace conflict caused by global variables automatically introduced by the esbuild compressor, not needed | None                                                                                                                                                |\n| extraBabelIncludes   | Switching to `extraIncludes` configuration                                                                           | `extraIncludes` configuration of `.umirc.ts`                                                                                                        |\n| extraBabelPlugins    | Switching to `swcLoader` configuration                                                                               | Use `swcLoader` configuration of `.umirc.ts`, check [Rsbuild](https://rsbuild.dev/zh/config/tools/swc) for details                                  |\n| extraBabelPresets    | As above                                                                                                             | As above                                                                                                                                            |\n| exportStatic         | Not tested                                                                                                           | 无                                                                                                                                                  |\n| extraPostCSSPlugins  | Switching to `postcssLoader` configuration                                                                           | Use `postcssLoader` configuration of `.umirc.ts`, check [Rsbuild](https://rsbuild.dev/zh/config/tools/postcss) for details                          |\n| forget               | Not tested                                                                                                           | None                                                                                                                                                |\n| jsMinifier           | Switching to `minify` configuration                                                                                  | Use `minify` configuration of `.umirc.ts`, check [Rsbuid](https://rsbuild.dev/zh/config/output/minify) for details                                  |\n| jsMinifierOptions    | As above                                                                                                             | As above                                                                                                                                            |\n| legacy               | Not supported                                                                                                        | None                                                                                                                                                |\n| mdx                  | Not supported                                                                                                        | Use `chainWebpack` function of `.umirc.ts`                                                                                                          |\n| mfsu                 | Not tested                                                                                                           | Use new added configuration `moduleFederation` of `.umirc.ts`, check [Rsbuild](https://rsbuild.dev/zh/config/module-federation/options) for details |\n| runtimePublicPath    | Hasn't test compatibility of webpack plugin `RuntimePublicPathPlugin`                                                | None                                                                                                                                                |\n| srcTranspiler        | Not supported, use `swcLoader`                                                                                       | None                                                                                                                                                |\n| srcTranspilerOptions | As above                                                                                                             | None                                                                                                                                                |\n\n`defineAUMIConfig` has comprehensive TypeScript typing support except Umi plugins' typing\n\n\n### Updating `package.json`\n\nUpdating `scripts` field of `package.json`.\n\n```diff title=\"package.json\"\n{\n  \"scripts\": {\n-   \"dev\": \"umi dev\",\n+   \"dev\": \"aumi dev\",\n-   \"build\": \"umi build\",\n+   \"build\": \"aumi build\",\n+   \"analyze\": \"RSDOCTOR=true aumi build\",\n-   \"postinstall\": \"umi setup\",\n+   \"postinstall\": \"aumi setup\",\n-   \"setup\": \"umi setup\",\n+   \"setup\": \"aumi setup\",\n    \"start\": \"npm run dev\"\n  }\n}\n```\n\nThe `analyze` command replaces Umi's `analyze` functionality by using [Rsdoctor](https://rsbuild.dev/zh/guide/debug/rsdoctor).\n\n## Start a new Project\n\nTake Umi [Getting Started](https://umijs.org/en-US/docs/guides/getting-started) as a reference to start a new project, and follow instructions above [Migration](#Migration)\n\n## Other changes\n\n### New configuration in `.umirc.ts`\n\n| Field           | Default value                                                                   | Usage                                                                                                                                                                                                                |\n|:----------------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| rsbuildConfig   | undefined                                                                       | Full RsbuildConfig and has higher priority than other configs, will be merged by [mergeRsbuildConfig](https://rsbuild.dev/api/javascript-api/core#mergersbuildconfig), [Reference](https://rsbuild.dev/config/index) |\n| aliasStrategy   | 'prefer-alias'                                                                  | The strategy of `alias` configuration, [Reference](https://rsbuild.dev/config/source/alias-strategy)                                                                                                                 |\n| transformImport | undefined                                                                       | Similar to `babel-plugin-import`, [Reference](https://rsbuild.dev/config/source/transform-import)                                                                                                                    |\n| react           | [reference](https://rsbuild.dev/plugins/list/plugin-react#%E9%80%89%E9%A1%B9)   | The configuration of Rsbuild plugin `@rsbuild/plugin-react`, [Reference](https://rsbuild.dev/plugins/list/plugin-react#%E9%80%89%E9%A1%B9)                                                                           |\n| rspack          | undefined                                                                       | Modify rspack configuration, [Reference](https://rsbuild.dev/config/tools/rspack)                                                                                                                                    |\n\n### Changes of Umi plugins' extended methods\n\nUmi provides massive extended methods by its plugin mechanism [Umi Plugin Api](https://umijs.org/en-US/docs/api/plugin-api).\nDue to we switch the bundler from `@umijs/bundler-webpack` to `Rsbuild`, some underlying build processes are inconsistent with `@umijs/bundler-webpack`. As a result, certain custom methods have been removed, if any removed methods are called, an error will be thrown out.\n\n\nRemove extended methods as below, most are `Babel` related:\n\n* [addExtraBabelPresets](https://umijs.org/docs/api/plugin-api#addextrababelpresets)\n* [addExtraBabelPlugins](https://umijs.org/docs/api/plugin-api#addextrababelplugins)\n* [addBeforeBabelPresets](https://umijs.org/docs/api/plugin-api#addbeforebabelpresets)\n* [addBeforeBabelPlugins](https://umijs.org/docs/api/plugin-api#addbeforebabelplugins)\n* [modifyWebpackConfig](https://umijs.org/docs/api/plugin-api#modifywebpackconfig)\n* [modifyViteConfig](https://umijs.org/docs/api/plugin-api#modifyviteconfig)\n* [modifyServerRendererPath](https://umijs.org/docs/api/plugin-api#modifyserverrendererpath)\n* modifyBabelPresetOpts\n\nAdd new extended methods for `Rsbuild`\n\n* `modifyRsbuildPlugins`: modifying `Rsbuild` plugins\n\nExample: \n```typescript\napi.modifyRsbuildPlugins(plugins =\u003e {\n  return plugins.slice(1);\n});\n```\n\n* `modifyRsbuildConfig`: modifying `RsbuildConfig` with the highest priority\n\nexample:\n```typescript\napi.modifyRsbuildConfig(config =\u003e {\n  config.root = './';\n  return config;\n});\n```\n\n## Remain issues\n\nTODO\n\n\n\n\n","funding_links":[],"categories":["Resources"],"sub_categories":["Ecosystem"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom-yang%2Faumi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatom-yang%2Faumi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom-yang%2Faumi/lists"}