vuloom is the public package surface for the Vue pagelet runtime and Vite plugin that powers vuloom apps.
pnpm add vuloomimport { vuloom } from "vuloom/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [vuloom()],
});import { defineConfig } from "vuloom/vite";
// Static config
export default defineConfig({
app: {
middlewares: ["auth"],
},
server: {
middleware: ["logger"],
},
dev: {
port: 3000,
},
});
// Or function config based on command/mode
export default defineConfig(({ command, mode }) => ({
app: {
middlewares: mode === "production" ? ["auth", "compress"] : ["auth"],
},
dev: {
port: command === "serve" ? 3000 : 4000,
},
}));
// Or async function for dynamic config
export default defineConfig(async ({ mode }) => {
const dbConfig = await loadDbConfig();
return {
app: {
middlewares: ["auth"],
},
server: {
middleware: dbConfig.middlewares,
},
};
});vuloomvuloom/vitevuloom/appvuloom/server
vuloom exports the package version.
vuloom/vite provides the Vite plugin, config utilities, and build tools.
vuloom/app is for app routes — Vue pages, loaders, actions.
vuloom/server is for server routes — API handlers, middleware.
For developing Vue page routes:
// loader.ts
import type { LoaderContext } from "vuloom/app";
export const loader = async (ctx: LoaderContext) => {
return { data: await fetchData() };
};// page.vue
import { useLoaderData, RouterView } from "vuloom/app";For developing API routes:
// route.ts
import type { ServerHandler } from "vuloom/server";
export const GET: ServerHandler = (ctx) => {
return Response.json({ hello: "world" });
};The CLI ships as vuloom via the package bin field:
npx vuloom dev
npx vuloom build
npx vuloom startCLI entry: vuloom/cli
import { runVuloomCli } from "vuloom/cli";- TypeScript 7 Migration: Remove
baseUrlsupport from generated.vuloom/tsconfig.typecheck.jsonwhen TypeScript 7 is released. Currently usingignoreDeprecations: "6.0"to suppress the deprecation warning.