browser-runtime-vue

Vue 3 SFC compiler and reactive renderer adapter for browser-module-runtime.
2,068
Install
npm install browser-runtime-vue
Latest Version:0.1.3
Vue:3
Last Updated:Oct 15, 2026
Links: npm
Maintainer: mizulu

browser-runtime-vue

Vue 3 SFC compilation and rendering adapter for browser-module-runtime.

import {createRuntime} from 'browser-module-runtime';
import {vue} from 'browser-runtime-vue';

const runtime=createRuntime({plugins:[vue({version:'3.5.18'})]});
runtime.define('/Counter.vue',`<script setup>
import {ref} from 'vue';
const count=ref(0);
</script>
<template><button @click="count++">Count: {{count}}</button></template>
<style scoped>button { color: royalblue }</style>`,{type:'vue'});
const mount=await runtime.mount({module:'/Counter.vue',target:'#app'});
await mount.updateProps({initial:5});
await mount.dispose();

The adapter loads vue/compiler-sfc lazily through the owning runtime's package resolver. Both compiler and renderer follow the same version pin. It supports normal JS <script>, <script setup>, <template>, ordinary and scoped CSS, and native reactive updateProps(). Stylesheet assets use the generic runtime's reference-counted style manager.

Declarative HTML: <script type="vue" module="/Counter.vue"> accepts <$script setup> ... </$script> to avoid premature HTML parser termination; <runtime-render> and custom-element="my-counter" use the existing generic controller. External .vue and runtime.define() source use regular <script>.

Current limitations: TypeScript/preprocessor SFC blocks, CSS Modules, external src blocks, and Shadow DOM integration are not included in this first adapter. Vue CSS v-bind() and associated compiler options have not been browser-verified. CDN browser tests require network access and the package version to be published.

Related Packages

@vue/component-compiler

bundler agnostic API for compiling Vue SFC

3,126,609 343
@vuedx/compiler-sfc

This package extracts `parse()` function [@vue/compiler-sfc] as ES module.

250,768 1,251
@vue/component-compiler-utils

Lower level utilities for compiling Vue single file components

65,523,325 322
mikuru

A compile-first JavaScript framework with Vue-like authoring and Svelte-like gen...

6,527 0
@cockernutx/brace-template

Brace-delimited control flow (@if, @for, @switch, @try) for Vue SFC templates

771 0

Version History

Version Released License
0.1.3
0.1.1
0.1.0
0.0.13
0.0.12
Pre-releases (2)
Version Released License
0.1.2-dev.0
0.0.0-stage