<script setup> all work without extra bundler wiring.
When Vue is a good fit
- You already ship production Vue apps.
- You prefer Vue single-file component authoring with scoped styles and the Composition API.
- You want extension UI surfaces that mirror existing Vue architecture.
Template examples
new-vue

extension-js/examples/new-vue
content-vue

extension-js/examples/content-vue
Usage with an existing extension
Add Vue to an existing extension with the steps below.Installation
Install the required dependencies:vue-loader or @vue/compiler-sfc is missing, the build error names the exact version that matches the bundled toolchain. The install command in the error is phrased for the package manager that your project uses.
Configuration
Extension.js expects Vue components in.vue files. It configures vue-loader, VueLoaderPlugin, and Vue-related define flags in the Rspack pipeline.
Development behavior
When Extension.js detects Vue, it:- Enables
.vuecompilation in the framework plugin. - Applies Vue runtime aliases (for consistent runtime resolution).
- Supports content script updates by remounting after relevant Vue SFC changes.
Troubleshooting
- Missing Vue tooling warning: Install
vue-loaderand@vue/compiler-sfc. - Prompt to restart after install: Stop and rerun
extension devso Extension.js can load the newly installed loader/plugin. - Unexpected
.vuehandling issues: Verifyvueis present in project dependencies so Extension.js detects Vue integration.
Usage examples
In a new tab extension
To use Vue in a new tab extension, include your entry file in HTML:In a content_script file
For content scripts, mount a Vue app into an injected root node:
Best practices
- Keep UI entrypoints framework-first (
main.ts,App.vue) and keep extension APIs in dedicated modules. - Use scoped styles in SFCs when possible to reduce style leaks in extension pages.
- For large UIs, split components and shared composables to keep content scripts small.
Next steps
- Learn more about TypeScript support.
- Explore Sass and Sass modules.

