{"id":20097510,"url":"https://github.com/jwyGithub/rsbuild-plugin-auto-alias","last_synced_at":"2025-05-06T05:31:53.082Z","repository":{"id":262201324,"uuid":"886440064","full_name":"jwyGithub/rsbuild-plugin-auto-alias","owner":"jwyGithub","description":"automatically generate alias based on path","archived":false,"fork":false,"pushed_at":"2024-11-20T07:52:35.000Z","size":152,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T11:02:01.361Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwyGithub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-11-11T01:13:14.000Z","updated_at":"2025-03-25T21:33:59.000Z","dependencies_parsed_at":"2025-01-11T06:27:38.239Z","dependency_job_id":"40e284ed-efeb-4d97-96d7-e99d480a7f44","html_url":"https://github.com/jwyGithub/rsbuild-plugin-auto-alias","commit_stats":null,"previous_names":["jwygithub/rsbuild-plugin-auto-alias"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwyGithub%2Frsbuild-plugin-auto-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwyGithub%2Frsbuild-plugin-auto-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwyGithub%2Frsbuild-plugin-auto-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwyGithub%2Frsbuild-plugin-auto-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwyGithub","download_url":"https://codeload.github.com/jwyGithub/rsbuild-plugin-auto-alias/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252629120,"owners_count":21779149,"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-11-13T17:01:14.254Z","updated_at":"2025-05-06T05:31:52.740Z","avatar_url":"https://github.com/jwyGithub.png","language":"TypeScript","readme":"# rsbuild-plugin-auto-alias\n\nautomatically generate alias based on path\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/rsbuild-plugin-auto-alias\" alt='version'\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dm/rsbuild-plugin-auto-alias\" alt='download'\u003e\n  \u003cimg src=\"https://img.shields.io/github/issues/jwyGithub/rsbuild-plugin-auto-alias\" alt='issues'\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/jwyGithub/rsbuild-plugin-auto-alias\" alt='license'\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n## Features\n\n-   Support for custom alias prefixes\n-   Supports synchronous mode configuration\n\n## Install\n\n#### pnpm\n\n```sh\npnpm add rsbuild-plugin-auto-alias -D\n```\n\n#### yarn\n\n```sh\nyarn add rsbuild-plugin-auto-alias -D\n```\n\n#### npm\n\n```sh\nnpm install rsbuild-plugin-auto-alias -D\n```\n\n## Use\n\n\u003e rsbuild.config.ts / rsbuild.config.js\n\n```typescript\nimport { defineConfig } from '@rsbuild/core';\nimport { pluginAutoAlias } from 'rsbuild-plugin-auto-alias';\n\nexport default defineConfig({\n    plugins: [pluginAutoAlias({})]\n});\n```\n\n## Option\n\n```typescript\nexport interface AutoAlias {\n    /**\n     * @description the root directory where the alias needs to be generated is src by default\n     * @default src\n     */\n    root?: string;\n\n    /**\n     * @description prefix for generating aliases\n     * @default @\n     */\n    prefix?: string;\n\n    /**\n     * @description synchronize the mode of json configuration\n     * @default all\n     */\n    mode?: 'sync' | 'off';\n\n    /**\n     * @description alias configuration file path\n     * @default tsconfig.json\n     */\n    aliasPath?: string;\n}\n```\n\n\u003e tsconfig.json / jsconfig.json\n\n```json\n{\n    \"compilerOptions\": {\n        \"baseUrl\": \"./\"\n        // ...\n    }\n}\n```\n\n## Example\n\n    |-- src\n        |-- plugins\n        |-- router\n        |-- scss\n        |-- store\n        |-- utils\n        |-- views\n        |-- ....\n\n```typescript\nimport xxx from '@plugins/xxx';\nimport xxx from '@router/xxx';\nimport xxx from '@scss/xxx';\nimport xxx from '@store/xxx';\nimport xxx from '@utils/xxx';\nimport xxx from '@views/xxx';\n```\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjwyGithub%2Frsbuild-plugin-auto-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FjwyGithub%2Frsbuild-plugin-auto-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjwyGithub%2Frsbuild-plugin-auto-alias/lists"}