{"id":13417478,"url":"https://github.com/vitjs/vit","last_synced_at":"2025-10-26T16:32:04.796Z","repository":{"id":50506027,"uuid":"351124560","full_name":"vitjs/vit","owner":"vitjs","description":"🚀  React application framework inspired by UmiJS / 类 UmiJS 的 React 应用框架","archived":false,"fork":false,"pushed_at":"2022-09-24T04:41:15.000Z","size":556,"stargazers_count":100,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-09T17:56:59.446Z","etag":null,"topics":["mock-data","react","react-framework","umi","umijs","vit","vite","vite-plugin","vite-plugin-react","vitjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"open_collective":"yuns","custom":["https://afdian.net/@yunslove"]}},"created_at":"2021-03-24T15:10:19.000Z","updated_at":"2024-05-22T03:38:20.000Z","dependencies_parsed_at":"2022-08-22T21:40:28.083Z","dependency_job_id":null,"html_url":"https://github.com/vitjs/vit","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitjs%2Fvit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitjs%2Fvit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitjs%2Fvit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitjs%2Fvit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitjs","download_url":"https://codeload.github.com/vitjs/vit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532448,"owners_count":18240792,"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":["mock-data","react","react-framework","umi","umijs","vit","vite","vite-plugin","vite-plugin-react","vitjs"],"created_at":"2024-07-30T22:00:37.884Z","updated_at":"2025-10-26T16:31:59.740Z","avatar_url":"https://github.com/vitjs.png","language":"TypeScript","funding_links":["https://opencollective.com/yuns","https://afdian.net/@yunslove"],"categories":["Plugins","TypeScript"],"sub_categories":["React"],"readme":"English | [简体中文](./README.zh-CN.md)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/vitjs/vit#vitjsvit\"\u003e\n    \u003cimg width=\"180\" src=\"./icons/logo.svg\" alt=\"Vit logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/vitjs/vit/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/vitjs/vit\" alt=\"GitHub stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@vitjs/vit\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@vitjs/vit.svg\" alt=\"npm package\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://nodejs.org/en/about/releases/\"\u003e\u003cimg src=\"https://img.shields.io/node/v/vite.svg\" alt=\"node compatility\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://vitejs.dev/\"\u003e\u003cimg src=\"https://img.shields.io/badge/vite-%3E%3D2.0.0-%234fc921\" alt=\"vite compatility\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Vit 🚀\n\n\u003e React application framework inspired by UmiJS.\n\n- ⚡️ Manually Defined Routing\n- ✨ Routing-based Code Splitting\n- 🎁 Exported Pure Static Application\n- 🎨 Mock Data, Usable in the Production\n\n### Routing\n\nThe framework takes over route definition and rendering, application entry. Developers only focus on business development after configure the route definition.\n\n### Mock Data\n\nBased on [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock), Built-in interception for **fetch**, you can easily use mock data in the production environment to facilitate project preview.\n\n## How to use?\n\n### Install\n\n```shell\n# Vite plugin, Core function realization\n$ yarn add @vitjs/vit --dev\n\n# Vit app runtime, provide application runtime related components\n$ yarn add @vitjs/runtime\n```\n\n### Config\n\n```html\n\u003c!-- index.html --\u003e\n\u003cbody\u003e\n  \u003cdiv id=\"root\"\u003e\u003c/div\u003e\n  \u003cscript type=\"module\" src=\"/@vit-app\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\n```ts\n// vite.config.ts\nimport type { UserConfig } from 'vite';\nimport vitApp from '@vitjs/vit';\n\nconst config: UserConfig = {\n  plugins: [\n    vitApp({\n      // Configure routing according to the project structure, and import components uniformly from the `src` directory\n      // icon currently supports automatic escaping as icons in [`@ant-design/icons`](https://ant.design/components/icon/#List-of-icons)\n      routes: [\n        {\n          path: '/',\n          component: './layouts/BasicLayout',\n          routes: [\n            {\n              path: '/',\n              redirect: '/welcome',\n              exact: true,\n            },\n            {\n              path: '/welcome',\n              icon: 'smile',\n              name: 'Welcome',\n              component: './pages/Welcome',\n            },\n          ],\n        },\n      ],\n    }),\n  ],\n};\n\nexport default config;\n```\n\n```js\n// tsconfig.json\n// For better TS type prompt, you need to add the following configuration\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@@/*\": [\"./src/.vit/*\"]\n    }\n  }\n}\n```\n\nIn addition, the plugin will generate runtime dependencies, so the `build` script of the application needs to remove the `tsc` command. In the end, add the directory `.vit` where the temporary files are located to `.gitignore`.\n\n### Auto import\n\n[`globalImports`](https://github.com/vitjs/vit/blob/master/packages/vit/src/types.ts#L9) lets you customize the files that need to be imported globally automatically. By default, you can see [`import.ts`](https://github.com/vitjs/vit/blob/master/packages/vit/src/generateFiles/import.ts#L2)\n\nIn particular, [`_app.tsx`](https://github.com/vitjs/vit/blob/master/packages/core/src/Service/index.ts#L21) can be automatically import to rewrite the application's rendering logic.\n\n### Upgrade\n\n```shell\n$ yarn upgrade --scope @vitjs\n\n$ yarn upgrade --scope @vitjs --latest\n```\n\n### Application Template\n\nFor more details, please refer directly to the application template **[yunsii/vite-react](https://github.com/yunsii/vite-react)**. It is worth noting that the current plugin is still under heavy development, API and usages are not set in stone yet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitjs%2Fvit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitjs%2Fvit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitjs%2Fvit/lists"}