{"id":18321629,"url":"https://github.com/bryanadamss/add-vue-suffix","last_synced_at":"2025-04-05T22:32:26.281Z","repository":{"id":48306275,"uuid":"389551165","full_name":"BryanAdamss/add-vue-suffix","owner":"BryanAdamss","description":"🔨Give some vue files ,find reference and add `.vue` suffix","archived":false,"fork":false,"pushed_at":"2021-11-22T03:24:24.000Z","size":84,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T13:14:17.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/BryanAdamss.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-07-26T07:45:41.000Z","updated_at":"2023-08-28T05:09:39.000Z","dependencies_parsed_at":"2022-08-22T12:21:27.768Z","dependency_job_id":null,"html_url":"https://github.com/BryanAdamss/add-vue-suffix","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryanAdamss%2Fadd-vue-suffix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryanAdamss%2Fadd-vue-suffix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryanAdamss%2Fadd-vue-suffix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryanAdamss%2Fadd-vue-suffix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BryanAdamss","download_url":"https://codeload.github.com/BryanAdamss/add-vue-suffix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934650,"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-05T18:20:30.179Z","updated_at":"2025-04-05T22:32:25.971Z","avatar_url":"https://github.com/BryanAdamss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# add-vue-suffix\n\n🔨Give some vue files ,find reference and add `.vue` suffix;(Useful for some project migrate to `vite` from `webpack`)\n\nEnglish | [中文](https://github.com/BryanAdamss/add-vue-suffix/blob/master/README.zh-CN.md)\n\n## Install\n\n```sh\nnpm i -D add-vue-suffix\n\nor\n\nyarn add add-vue-suffix -D\n```\n\n## Usage\n\n### with cli\n\n```bash\nnpx add-vue-suffix --resolveConifg ./path/to/resolve-config.js\n```\n\nor\n\n```json\n{\n  \"scripts\": {\n    \"add-vue-suffix\": \"add-vue-suffix --resolveConifg ./path/to/resolve-config.js\"\n  }\n}\n```\n\n- `resolveConifg` is a path to a `enhanced-resolve` config file;\n- Because [`webpack` use `enhanced-resolve` underhood](https://webpack.js.org/concepts/module-resolution/),so you just point to a `webpack config` that contain `resolve` property.\n- etc\n\n```js\n// webpack.config.js\nconst path = require('path')\n\nmodule.exports={\n  input:'./src/index.js',\n\n  ...,\n\n  resolve:{\n    extensions: ['.js', '.vue', '.json'],\n    alias: {\n      '@': path.resolve('src'),\n      Api: path.resolve('src/api'),\n      Api2: path.resolve('src/api2'),\n      Assets: path.resolve('src/assets'),\n      Base: path.resolve('src/base'),\n      Config: path.resolve('src/config'),\n      Components: path.resolve('src/components'),\n      Directives: path.resolve('src/directives'),\n      Plugins: path.resolve('src/plugins'),\n      Routes: path.resolve('src/routes'),\n      Sass: path.resolve('src/sass'),\n      Services: path.resolve('src/services'),\n      Stores: path.resolve('src/stores'),\n      Utils: path.resolve('src/utils'),\n      Views: path.resolve('src/views')\n  }\n}\n```\n\n- If you use `vue-cli` or other not emit `webpack config` cli,you can just create a `js` file that export a object that contain `resolve` property like above.\n\n### with function\n\n```js\nimport addVueSuffix from 'add-vue-suffix'\n\naddVueSuffix({\n  withAST = false, // add-vue-suffix use regexp to replace import/export/import() by default;If you got some error,set this to true,it will use babel to replace import/export/import();\n  patterns = ['src/**/*.vue', 'src/**/*.js'], // some file may be import vue file;search `vue` and `js` under `src` by default;\n  globbyOptions = {}, // custom globby options, it will override default globby options;\n  resolveConfig = {}, // https://www.npmjs.com/package/enhanced-resolve；https://webpack.js.org/configuration/resolve/#resolve\n  debug = false,// set true will not rewrite file;\n})\n```\n\n## NPM\n\n- [vue-cli-plugin-auto-alias](https://www.npmjs.com/package/vue-cli-plugin-auto-alias)\n- [@bryanadamss/drawing-board](https://www.npmjs.com/package/@bryanadamss/drawing-board)\n- [@bryanadamss/num2chn](https://www.npmjs.com/package/@bryanadamss/num2chn)\n- [ant-color-converter](https://www.npmjs.com/package/ant-color-converter)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2021 [BryanAdamss@foxmail.com](https://github.com/BryanAdamss).\u003cbr /\u003e\nThis project is [MIT](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE) licensed.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://bryanadamss.github.io/\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/7441504?v=4\" width=\"64px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGuangHui\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#projectManagement-BryanAdamss\" title=\"Project Management\"\u003e📆\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanadamss%2Fadd-vue-suffix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanadamss%2Fadd-vue-suffix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanadamss%2Fadd-vue-suffix/lists"}