+5
-27
@@ -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 } } },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user