{"id":14977083,"url":"https://github.com/mys1024/vite-plugin-easy-resolve-alias","last_synced_at":"2026-02-10T08:31:40.887Z","repository":{"id":60564232,"uuid":"543996110","full_name":"mys1024/vite-plugin-easy-resolve-alias","owner":"mys1024","description":"Make it easy to config Vite's resolve alias.","archived":false,"fork":false,"pushed_at":"2022-10-21T18:45:43.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T12:12:23.852Z","etag":null,"topics":["alias","easy","plugin","resolve","simplify","vite","vitejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vite-plugin-easy-resolve-alias","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/mys1024.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-01T11:08:43.000Z","updated_at":"2022-12-08T14:26:18.000Z","dependencies_parsed_at":"2023-01-20T08:00:39.872Z","dependency_job_id":null,"html_url":"https://github.com/mys1024/vite-plugin-easy-resolve-alias","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mys1024/vite-plugin-easy-resolve-alias","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mys1024%2Fvite-plugin-easy-resolve-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mys1024%2Fvite-plugin-easy-resolve-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mys1024%2Fvite-plugin-easy-resolve-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mys1024%2Fvite-plugin-easy-resolve-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mys1024","download_url":"https://codeload.github.com/mys1024/vite-plugin-easy-resolve-alias/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mys1024%2Fvite-plugin-easy-resolve-alias/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29294579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T03:42:42.660Z","status":"ssl_error","status_checked_at":"2026-02-10T03:42:41.897Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["alias","easy","plugin","resolve","simplify","vite","vitejs"],"created_at":"2024-09-24T13:55:01.530Z","updated_at":"2026-02-10T08:31:40.854Z","avatar_url":"https://github.com/mys1024.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-easy-resolve-alias\n\nMake it easy to config [Vite](https://vitejs.dev/)'s [resolve alias](https://vitejs.dev/config/shared-options.html#resolve-alias).\n\n## Install\n\n```shell\nnpm install -D vite-plugin-easy-resolve-alias\n```\n\n## Usage\n\n### Basic\n\nAdd this plugin in your `vite.config.js`:\n\n```javascript\nimport { defineConfig } from 'vite'\nimport ResolveAlias from 'vite-plugin-easy-resolve-alias'\n\nexport default defineConfig({\n  plugins: [\n    ResolveAlias({ '~/': 'src/' })\n  ]\n})\n```\n\nthen you can use the alias you configured:\n\n```javascript\nimport foo from '~/foo'\nconst bar = foo()\n```\n\n### Use RegExp\n\nRegular expression is allowed while passing in an array like this:\n\n```javascript\nimport { defineConfig } from 'vite'\nimport ResolveAlias from 'vite-plugin-easy-resolve-alias'\n\nexport default defineConfig({\n  plugins: [\n    ResolveAlias([{ find: /^~\\//, replacement: 'src/' }])\n  ]\n})\n```\n\n## TypeScript Support\n\nIf you are using **TypeScript**, don't forget to configure your `tsconfig.json` like this:\n\n```json\n{\n  \"compilerOptions\": {\n    \"paths\": {\n      \"~/*\": [\"./src/*\"]\n    }\n  }\n}\n```\n\n## Comparison\n\nBefore:\n\n```javascript\nimport { defineConfig } from 'vite'\nimport path from 'path'\nimport Vue from '@vitejs/plugin-vue'\n\nexport default defineConfig({\n  plugins: [\n    Vue()\n  ],\n  resolve: {\n    alias: {\n      '~/': `${path.resolve(__dirname, 'src')}/`\n    }\n  }\n})\n```\n\nAfter:\n\n```javascript\nimport { defineConfig } from 'vite'\nimport ResolveAlias from 'vite-plugin-easy-resolve-alias'\nimport Vue from '@vitejs/plugin-vue'\n\nexport default defineConfig({\n  plugins: [\n    ResolveAlias({ '~/': 'src/' }),\n    Vue()\n  ]\n})\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmys1024%2Fvite-plugin-easy-resolve-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmys1024%2Fvite-plugin-easy-resolve-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmys1024%2Fvite-plugin-easy-resolve-alias/lists"}