Skip to content

Vue

A Vue app is a Vite app, so it deploys with GCP.Website.Vite. Vue Router’s history mode works out of the box: unknown paths answer with index.html.

Terminal window
pnpm add -D https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/a870ed4

Docker has to be running when you deploy.

Terminal window
pnpm create vite web --template vue-ts
cd web && pnpm install && cd ..

Keep the generated vite.config.ts as it is.

alchemy.run.ts
import * as Alchemy from "alchemy";
import * as GCP from "@alchemy.run/gcp";
import * as Effect from "effect/Effect";
export const Website = GCP.Website.Vite("Website", { rootDir: "./web" });
export default Alchemy.Stack(
"MyVueApp",
{ providers: GCP.providers(), state: GCP.state() },
Effect.gen(function* () {
const site = yield* Website;
return { url: site.url };
}),
);
Terminal window
bun alchemy deploy

When you add Vue Router in history mode, deep links work as they are: the server answers unknown paths with index.html.

alchemy dev runs Vite’s dev server with hot reload.

  • Vite — env values, base paths, and 404 pages.
  • Nuxt — when you need server rendering.