@rsbuild/plugin-vue2
| Install | |
|---|---|
npm install @rsbuild/plugin-vue2 |
|
| Latest Version: | 1.2.0 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Oct 15, 2026 |
| Links: | GitHub · npm |
@rsbuild/plugin-vue2
Provides support for Vue 2 SFC (Single File Components). The plugin internally integrates vue-loader v15.
@rsbuild/plugin-vue2 only supports Vue >= 2.7.0.
Usage
Install:
npm add @rsbuild/plugin-vue2 -D
Add plugin to your rsbuild.config.ts:
// rsbuild.config.ts
import { pluginVue2 } from '@rsbuild/plugin-vue2';
export default {
plugins: [pluginVue2()],
};
After registering the plugin, you can import *.vue files in your code.
Options
If you need to customize the compilation behavior of Vue, you can use the following configs.
vueLoaderOptions
Options passed to vue-loader, please refer to the vue-loader documentation for detailed usage.
- Type:
VueLoaderOptions - Default:
const defaultOptions = {
compilerOptions: {
whitespace: 'condense',
},
experimentalInlineMatchResource: true,
};
- Example:
pluginVue2({
vueLoaderOptions: {
hotReload: false,
},
});
The Vue 2 plugin is using the
vue-loaderv15. Please be aware that there may be configuration differences between v15 and the latest version.
splitChunks
When chunkSplit.strategy set to split-by-experience, Rsbuild will automatically split vue and router related packages into separate chunks by default:
lib-vue.js: includes vue, vue-loader.lib-router.js: includes vue-router.
This option is used to control this behavior and determine whether the vue and router related packages need to be split into separate chunks.
- Type:
type SplitVueChunkOptions = {
vue?: boolean;
router?: boolean;
};
- Default:
const defaultOptions = {
vue: true,
router: true,
};
- Example:
pluginVue({
splitChunks: {
vue: false,
router: false,
},
});
FAQ
/deep/ selector causes compilation error
/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.
You can use :deep() instead. See Vue - Deep Selectors for more details.
<style scoped>
.a :deep(.b) {
/* ... */
}
</style>
You can also refer to Vue - RFC 0023 for more details.
License
MIT.
Related Packages
Provides support for Vue 3 JSX / TSX syntax. This plugin internally integrates @...
Provides support for Vue 2 JSX / TSX syntax. The plugin internally integrates @v...
Version History
| Version | Released | License |
|---|---|---|
| 1.2.0 | MIT | |
| 1.1.2 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.7.10 | MIT | |
| 0.7.9 | MIT | |
| 0.7.8 | MIT | |
| 0.7.7 | MIT | |
| 0.7.6 | MIT | |
| 0.7.5 | MIT | |
| 0.7.4 | MIT | |
| 0.7.3 | MIT | |
| 0.7.2 | MIT | |
| 0.7.1 | MIT | |
| 0.7.0 | MIT | |
| 0.6.15 | MIT | |
| 0.6.14 | MIT | |
| 0.6.13 | MIT | |
| 0.6.12 | MIT | |
| 0.6.11 | MIT | |
| 0.6.10 | MIT | |
| 0.6.9 | MIT | |
| 0.6.8 | MIT |
Showing the latest 30 of 126. See every release on npm
Pre-releases (91)
| Version | Released | License |
|---|---|---|
| 1.0.1-beta.16 | MIT | |
| 1.0.1-beta.15 | MIT | |
| 1.0.1-beta.14 | MIT | |
| 1.0.1-beta.13 | MIT | |
| 1.0.1-beta.12 | MIT | |
| 1.0.1-beta.11 | MIT | |
| 1.0.1-beta.10 | MIT | |
| 1.0.1-beta.9 | MIT | |
| 1.0.1-beta.8 | MIT | |
| 1.0.1-beta.7 | MIT | |
| 1.0.1-beta.6 | MIT | |
| 1.0.1-beta.5 | MIT | |
| 1.0.1-beta.4 | MIT | |
| 1.0.1-beta.3 | MIT | |
| 1.0.1-beta.2 | MIT | |
| 1.0.1-beta.1 | MIT | |
| 1.0.1-beta.0 | MIT | |
| 1.0.0-alpha.9 | MIT | |
| 1.0.0-alpha.8 | MIT | |
| 1.0.0-alpha.7 | MIT | |
| 1.0.0-alpha.6 | MIT | |
| 1.0.0-alpha.5 | MIT | |
| 1.0.0-alpha.4 | MIT | |
| 1.0.0-alpha.3 | MIT | |
| 1.0.0-alpha.2 | MIT | |
| 1.0.0-alpha.1 | MIT | |
| 1.0.0-alpha.0 | MIT | |
| 0.7.0-beta.9 | MIT | |
| 0.7.0-beta.8 | MIT | |
| 0.7.0-beta.7 | MIT |
Showing the latest 30 of 91. See every release on npm