refactor(web): use real core in demos and tests (#4, #5)

This commit is contained in:
Florian Schmidt
2026-11-16 00:21:03 +01:00
parent 4e79af3e24
commit 08d5441cf2
6 changed files with 8 additions and 237 deletions
+5 -27
View File
@@ -1,29 +1,7 @@
import { defineConfig, loadEnv } from "vite";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { fileURLToPath } from "node:url";
export default defineConfig(({ mode }) => {
const mock =
loadEnv(mode, process.cwd(), "").VITE_MOCK === "1" ||
process.env.VITE_MOCK === "1";
return {
plugins: [react()],
build: { target: "es2022" },
// TEMPORARY: delete this alias and src/mock/core.ts once M0 lands.
resolve: {
alias: mock
? [
{
find: /^@shellbook\/core$/,
replacement: fileURLToPath(
new URL("./src/mock/core.ts", import.meta.url),
),
},
]
: [],
},
server: {
proxy: { "/api": { target: "http://127.0.0.1:8080", ws: true } },
},
};
export default defineConfig({
plugins: [react()],
build: { target: "es2022" },
server: { proxy: { "/api": { target: "http://127.0.0.1:8080", ws: true } } },
});