{"id":14693320,"url":"https://github.com/rspack-contrib/rsbuild-plugin-vue2","last_synced_at":"2025-04-14T10:13:55.338Z","repository":{"id":254650585,"uuid":"847144437","full_name":"rspack-contrib/rsbuild-plugin-vue2","owner":"rspack-contrib","description":"An Rsbuild plugin to support for Vue 2 SFC (Single File Components).","archived":false,"fork":false,"pushed_at":"2025-04-01T02:31:18.000Z","size":131,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T10:13:49.651Z","etag":null,"topics":["rsbuild","rsbuild-plugin","rspack"],"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/rspack-contrib.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T01:27:30.000Z","updated_at":"2025-04-01T02:31:21.000Z","dependencies_parsed_at":"2024-11-09T09:17:59.758Z","dependency_job_id":"9fb2025e-432c-4c80-b065-6e302c9645cc","html_url":"https://github.com/rspack-contrib/rsbuild-plugin-vue2","commit_stats":null,"previous_names":["rspack-contrib/rsbuild-plugin-vue2"],"tags_count":2,"template":false,"template_full_name":"rspack-contrib/rsbuild-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-vue2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-vue2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-vue2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-vue2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rspack-contrib","download_url":"https://codeload.github.com/rspack-contrib/rsbuild-plugin-vue2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860167,"owners_count":21173342,"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":["rsbuild","rsbuild-plugin","rspack"],"created_at":"2024-09-13T02:01:13.390Z","updated_at":"2025-04-14T10:13:55.316Z","avatar_url":"https://github.com/rspack-contrib.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"readme":"# @rsbuild/plugin-vue2\n\nProvides support for Vue 2 SFC (Single File Components). The plugin internally integrates [vue-loader](https://vue-loader.vuejs.org/) v15.\n\n\u003e @rsbuild/plugin-vue2 only supports Vue \u003e= 2.7.0.\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/@rsbuild/plugin-vue2\"\u003e\n   \u003cimg src=\"https://img.shields.io/npm/v/@rsbuild/plugin-vue2?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"license\" /\u003e\n\u003c/p\u003e\n\n## Usage\n\nInstall:\n\n```bash\nnpm add @rsbuild/plugin-vue2 -D\n```\n\nAdd plugin to your `rsbuild.config.ts`:\n\n```ts\n// rsbuild.config.ts\nimport { pluginVue2 } from \"@rsbuild/plugin-vue2\";\n\nexport default {\n  plugins: [pluginVue2()],\n};\n```\n\nAfter registering the plugin, you can import `*.vue` files in your code.\n\n## Options\n\nIf you need to customize the compilation behavior of Vue, you can use the following configs.\n\n### vueLoaderOptions\n\nOptions passed to `vue-loader`, please refer to the [vue-loader documentation](https://vue-loader.vuejs.org/) for detailed usage.\n\n- **Type:** `VueLoaderOptions`\n- **Default:**\n\n```js\nconst defaultOptions = {\n  compilerOptions: {\n    whitespace: \"condense\",\n  },\n  experimentalInlineMatchResource: true,\n};\n```\n\n- **Example:**\n\n```ts\npluginVue2({\n  vueLoaderOptions: {\n    hotReload: false,\n  },\n});\n```\n\n\u003e The Vue 2 plugin is using the `vue-loader` v15. Please be aware that there may be configuration differences between v15 and the latest version.\n\n### splitChunks\n\nWhen [chunkSplit.strategy](/config/performance/chunk-split) set to `split-by-experience`, Rsbuild will automatically split `vue` and `router` related packages into separate chunks by default:\n\n- `lib-vue.js`: includes vue, vue-loader.\n- `lib-router.js`: includes vue-router.\n\nThis option is used to control this behavior and determine whether the `vue` and `router` related packages need to be split into separate chunks.\n\n- **Type:**\n\n```ts\ntype SplitVueChunkOptions = {\n  vue?: boolean;\n  router?: boolean;\n};\n```\n\n- **Default:**\n\n```ts\nconst defaultOptions = {\n  vue: true,\n  router: true,\n};\n```\n\n- **Example:**\n\n```ts\npluginVue({\n  splitChunks: {\n    vue: false,\n    router: false,\n  },\n});\n```\n\n## FAQ\n\n### /deep/ selector causes compilation error\n\n`/deep/` is a deprecated usage as of Vue v2.7. Since it is not a valid CSS syntax, CSS compilation tools like Lightning CSS will fail to compile it.\n\nYou can use `:deep()` instead. See [Vue - Deep Selectors](https://vuejs.org/api/sfc-css-features.html#deep-selectors) for more details.\n\n```html\n\u003cstyle scoped\u003e\n  .a :deep(.b) {\n    /* ... */\n  }\n\u003c/style\u003e\n```\n\n\u003e You can also refer to [Vue - RFC 0023](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0023-scoped-styles-changes.md) for more details.\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-vue2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-vue2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-vue2/lists"}