forked from phenom/healer-man
Release Healer Man 0.1.29
This commit is contained in:
1 parent
8c9809d3e0
commit
544c1bee91
120 files changed
+4363
-1036
No files matched your search
+11
-1
@@ -2,6 +2,8 @@ import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { defineConfig } from "vitest/config";
|
||||
import react from "@vitejs/plugin-react";
|
||||
// @ts-expect-error Shared Node HTTP middleware also serves production bundles.
|
||||
import { createBundledContentHandler } from "./server/bundled-content.mjs";
|
||||
|
||||
const packageVersion = (JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as { version: string }).version;
|
||||
|
||||
@@ -9,7 +11,15 @@ export default defineConfig(({ mode }) => {
|
||||
const androidBuild = mode === "android";
|
||||
const downloadableBuild = androidBuild || mode === "production";
|
||||
return {
|
||||
plugins: [react()],
|
||||
plugins: [react(), {
|
||||
name: "bundled-content-preview",
|
||||
configurePreviewServer(server) {
|
||||
const serve = createBundledContentHandler(path.resolve(androidBuild ? "dist-android" : "dist"));
|
||||
server.middlewares.use((request, response, next) => {
|
||||
if (!serve(request, response, new URL(request.url ?? "/", "http://localhost").pathname)) next();
|
||||
});
|
||||
},
|
||||
}],
|
||||
publicDir: androidBuild ? ".android-public" : downloadableBuild ? ".web-public" : "public",
|
||||
define: {
|
||||
"import.meta.env.VITE_APP_VERSION": JSON.stringify(packageVersion),
|
||||
|
||||
Reference in new issue
Block a user