{"id":17242836,"url":"https://github.com/imcuttle/suffix-resolve-plugin","last_synced_at":"2025-07-19T06:37:47.559Z","repository":{"id":45113223,"uuid":"437729920","full_name":"imcuttle/suffix-resolve-plugin","owner":"imcuttle","description":"enhanced-resolve 插件，为了支持 resolve 不同优先级后缀路径","archived":false,"fork":false,"pushed_at":"2022-01-07T14:13:12.000Z","size":73,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T14:09:41.932Z","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/imcuttle.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}},"created_at":"2021-12-13T03:57:30.000Z","updated_at":"2024-07-14T05:44:41.000Z","dependencies_parsed_at":"2022-09-12T02:21:38.213Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/suffix-resolve-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/imcuttle/suffix-resolve-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fsuffix-resolve-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fsuffix-resolve-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fsuffix-resolve-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fsuffix-resolve-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/suffix-resolve-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fsuffix-resolve-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265898344,"owners_count":23845776,"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-10-15T06:14:13.515Z","updated_at":"2025-07-19T06:37:47.537Z","avatar_url":"https://github.com/imcuttle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# suffix-resolve-plugin\n\n[![Build status](https://img.shields.io/travis/余聪/suffix-resolve-plugin/master.svg?style=flat-square)](https://travis-ci.com/余聪/suffix-resolve-plugin)\n[![Test coverage](https://img.shields.io/codecov/c/github/余聪/suffix-resolve-plugin.svg?style=flat-square)](https://codecov.io/github/余聪/suffix-resolve-plugin?branch=master)\n[![NPM version](https://img.shields.io/npm/v/suffix-resolve-plugin.svg?style=flat-square)](https://www.npmjs.com/package/suffix-resolve-plugin)\n[![NPM Downloads](https://img.shields.io/npm/dm/suffix-resolve-plugin.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/suffix-resolve-plugin)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)\n\n\u003e enhanced-resolve 插件，为了支持 resolve 不同优先级后缀路径\n\n如下：\n\n```text\nfoo.js\ndir/\n  index.js\n  index.dev.js\n  index.prod.js\n```\n\n在 foo.js 中，require('./dir'), 将会根据 suffixList 的匹配顺序，依次进行命中，如 suffixList = ['.dev', '']\n则 require('./dir') 则会解析成 require('./dir/index.dev.js')\n\n经常被用在需要构建不同环境的代码的场景，如跨端代码等\n\n## Installation\n\n```bash\nnpm install suffix-resolve-plugin\n# or use yarn\nyarn add suffix-resolve-plugin\n```\n\n## Usage\n\n```javascript\nimport { SuffixResolvePlugin } from 'suffix-resolve-plugin'\n\nwebpackConfig = {\n  resolve: {\n    plugins: [\n      new SuffixResolvePlugin({\n        suffixList: ['.dev', ''],\n        dir: contextPath\n      })\n    ]\n  }\n}\n```\n\n## Contributing\n\n- Fork it!\n- Create your new branch:  \n  `git checkout -b feature-new` or `git checkout -b fix-which-bug`\n- Start your magic work now\n- Make sure npm test passes\n- Commit your changes:  \n  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`\n- Push to the branch: `git push`\n- Submit a pull request :)\n\n## Authors\n\nThis library is written and maintained by 余聪, \u003ca href=\"mailto:yucong@yuanfudao.com\"\u003eyucong@yuanfudao.com\u003c/a\u003e.\n\n## License\n\nMIT - [余聪](https://github.com/余聪) 🐟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fsuffix-resolve-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fsuffix-resolve-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fsuffix-resolve-plugin/lists"}