Browse Source

reverting vite config

pull/627/head
Dan Ditomaso 1 year ago
parent
commit
e5ee476f3f
  1. 6
      package.json
  2. 31
      vite.config.ts

6
package.json

@ -34,12 +34,12 @@
}, },
"homepage": "https://meshtastic.org", "homepage": "https://meshtastic.org",
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^2.2.5",
"@meshtastic/core": "npm:@jsr/[email protected]", "@meshtastic/core": "npm:@jsr/[email protected]",
"@meshtastic/js": "npm:@jsr/[email protected]", "@meshtastic/js": "npm:@jsr/[email protected]",
"@meshtastic/transport-http": "npm:@jsr/meshtastic__transport-http", "@meshtastic/transport-http": "npm:@jsr/meshtastic__transport-http",
"@meshtastic/transport-web-bluetooth": "npm:@jsr/meshtastic__transport-web-bluetooth", "@meshtastic/transport-web-bluetooth": "npm:@jsr/meshtastic__transport-web-bluetooth",
"@meshtastic/transport-web-serial": "npm:@jsr/meshtastic__transport-web-serial", "@meshtastic/transport-web-serial": "npm:@jsr/meshtastic__transport-web-serial",
"@bufbuild/protobuf": "^2.2.5",
"@noble/curves": "^1.9.0", "@noble/curves": "^1.9.0",
"@radix-ui/react-accordion": "^1.2.8", "@radix-ui/react-accordion": "^1.2.8",
"@radix-ui/react-checkbox": "^1.2.3", "@radix-ui/react-checkbox": "^1.2.3",
@ -111,7 +111,7 @@
"testing-library": "^0.0.2", "testing-library": "^0.0.2",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vite": "^6.3.4", "vite": "^6.3.4",
"vitest": "^3.1.2", "vite-plugin-pwa": "^1.0.0",
"vite-plugin-pwa": "^1.0.0" "vitest": "^3.1.2"
} }
} }

31
vite.config.ts

@ -1,26 +1,15 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa"; import { VitePWA } from "vite-plugin-pwa";
import { resolve } from "@std/path/resolve"; import { execSync } from "node:child_process";
import process from "node:process";
import path from "node:path";
let hash = ""; let hash = "";
try { try {
const command = new Deno.Command("git", { hash = execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
args: ["rev-parse", "--short", "HEAD"],
stdout: "piped",
stderr: "piped",
});
const { code, stdout, stderr } = await command.output();
if (code === 0) {
hash = new TextDecoder().decode(stdout).trim();
} else {
const errorOutput = new TextDecoder().decode(stderr);
console.error("Error getting git hash:", errorOutput);
hash = "DEV";
}
} catch (error) { } catch (error) {
console.error("Failed to execute git command:", error); console.error("Error getting git hash:", error);
hash = "DEV"; hash = "DEV";
} }
@ -48,11 +37,11 @@ export default defineConfig({
}, },
resolve: { resolve: {
alias: { alias: {
"@app": resolve(Deno.cwd(), "./src"), "@app": path.resolve(process.cwd(), "./src"),
"@pages": resolve(Deno.cwd(), "./src/pages"), "@pages": path.resolve(process.cwd(), "./src/pages"),
"@components": resolve(Deno.cwd(), "./src/components"), "@components": path.resolve(process.cwd(), "./src/components"),
"@core": resolve(Deno.cwd(), "./src/core"), "@core": path.resolve(process.cwd(), "./src/core"),
"@layouts": resolve(Deno.cwd(), "./src/layouts"), "@layouts": path.resolve(process.cwd(), "./src/layouts"),
}, },
}, },
server: { server: {

Loading…
Cancel
Save