44 lines
1018 B
TypeScript
44 lines
1018 B
TypeScript
import { defineConfig } from "vite";
|
|
import solid from "vite-plugin-solid";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// @ts-expect-error process is a nodejs global
|
|
const host = process.env.TAURI_DEV_HOST;
|
|
|
|
export default defineConfig(async () => ({
|
|
plugins: [solid(), tailwindcss()],
|
|
|
|
// prosemirror deduplication - prevents keyed plugin conflicts with tiptap
|
|
optimizeDeps: {
|
|
include: [
|
|
"prosemirror-state",
|
|
"prosemirror-transform",
|
|
"prosemirror-model",
|
|
"prosemirror-view",
|
|
],
|
|
},
|
|
|
|
clearScreen: false,
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
// only bind to network if TAURI_DEV_HOST is set for mobile dev,
|
|
// otherwise lock to loopback only
|
|
host: host || "127.0.0.1",
|
|
hmr: host
|
|
? {
|
|
protocol: "ws",
|
|
host,
|
|
port: 1421,
|
|
}
|
|
: undefined,
|
|
watch: {
|
|
ignored: ["**/src-tauri/**"],
|
|
},
|
|
headers: {
|
|
"X-Content-Type-Options": "nosniff",
|
|
"X-Frame-Options": "DENY",
|
|
},
|
|
},
|
|
}));
|