Runable v1.0.0-alpha.20
Why Runable? Docs Modules Work with AI Blog About Changelog
  • 01Why Runable?
  • 02Docs
  • 03Modules
  • 04Work with AI
  • 05Blog
  • 06About
  • 07Changelog
Vue without a fixed server runtime.
Getting Started Structure Integrations Guide MCP API
  • Getting Started Structure Integrations Guide MCP API
Build the Interface
  • Routing
  • Layouts
  • Middlewares
  • Error Handling
Load and Render
  • Data Fetching
  • SSR and CSR
  • Head and SEO
Extend Runable
  • Auto-imports
  • Plugins
  • Modules
Configure and Ship
  • Runtime Configuration
  • CSS and Assets
  • Production Build
CLI
  • Overview
  • Create
  • Prepare
  • Build
  • MCP
  • AI Skills
  • Inspector

Plugins

Initialize libraries, provide dependencies, and order Vue application startup.

A plugin runs while the Vue application is created, before rendering. Put it in app/plugins/ when a feature must be installed once per instance.

Create a plugin

// app/plugins/api.ts
export default defineVuePlugin((vueApp) => {
  vueApp.directive("focus", {
    mounted(element) {
      element.focus();
    },
  });

  return {
    provide: {
      apiBase: "/api",
    },
  };
});

Values in provide are registered with app.provide() and as $-prefixed global properties.

Declare order

// app/plugins/tracking.ts
export default defineVuePlugin({
  name: "tracking",
  enforce: "post",
  dependsOn: ["api"],
  setup() {
    // Initialization
  },
});
OptionPurpose
nameIdentifies the plugin in dependencies
enforce: "pre"Runs before plugins without priority
enforce: "post"Runs after plugins without priority
dependsOnWaits for named plugins in the same group
setupConfigures the Vue application
hooksRegisters Runable runtime hooks

Runable sorts pre, normal, and post groups separately, then resolves dependsOn. A circular dependency throws an explicit error. A missing dependency produces a warning.

Keep SSR isolated

During SSR, Runable creates one Vue application per render. Create mutable state inside setup():

export default defineVuePlugin(() => {
  const state = reactive({ user: null });
  return { provide: { session: state } };
});

Do not store user state in a mutable module-level variable because requests could share it.

Plugin or module?

A plugin initializes Vue at runtime. A module configures Runable and can provide several plugins, components, layouts, or other collections.

Report an issue Edit this page
Auto-imports

Automatically use application components, composables, and global functions.

Modules

Group and distribute a configurable Runable feature.

On this page

  • 1Create a plugin
  • 2Declare order
  • 3Keep SSR isolated
Runable

The Vue framework that brings productive conventions to any backend.

Product

  • Why Runable
  • Documentation
  • Installation
  • Integrations

Project

  • About
  • Blog
  • Changelog
  • Sponsor

Community

  • GitHub
  • Issues
  • Discussions
  • Bluesky

© 2026 Runable. Released under the MIT License.

Open source Built with Vue and Runable