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.
Install
Section titled “Install”pnpm add -D https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/a870ed4bun add -d https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/a870ed4npm install -D https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/a870ed4yarn add -D https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/a870ed4Docker has to be running when you deploy.
Scaffold the app
Section titled “Scaffold the app”pnpm create vite web --template vue-tscd web && pnpm install && cd ..bun create vite@latest web -- --template vue-tscd web && bun install && cd ..npm create vite@latest web -- --template vue-tscd web && npm install && cd ..yarn create vite web --template vue-tscd web && yarn install && cd ..Keep the generated vite.config.ts as it is.
Deploy the site
Section titled “Deploy the site”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 }; }),);bun alchemy deployWhen you add Vue Router in history mode,
deep links work as they are: the server answers unknown paths with
index.html.
Local development
Section titled “Local development”alchemy dev runs Vite’s dev server with hot reload.