11111
This commit is contained in:
42
vite.config.js
Normal file
42
vite.config.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import monacoEditorPluginRaw from "vite-plugin-monaco-editor";
|
||||
|
||||
const monacoEditorPlugin =
|
||||
typeof monacoEditorPluginRaw === "function"
|
||||
? monacoEditorPluginRaw
|
||||
: monacoEditorPluginRaw.default;
|
||||
|
||||
const host = process.env.TAURI_DEV_HOST;
|
||||
|
||||
export default defineConfig({
|
||||
base: process.env.NODE_ENV === "production" ? "/images/newyaoyan/" : "/",
|
||||
plugins: [monacoEditorPlugin({}), vue(), tailwindcss()],
|
||||
build: {
|
||||
outDir: process.env.VITE_BUILD_OUT_DIR || "dist",
|
||||
},
|
||||
clearScreen: false,
|
||||
server: {
|
||||
port: 1420,
|
||||
strictPort: true,
|
||||
host: host || false,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://127.0.0.1:8001",
|
||||
changeOrigin: true,
|
||||
},
|
||||
"/images": {
|
||||
target: "http://127.0.0.1:8001",
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
hmr: host
|
||||
? {
|
||||
protocol: "ws",
|
||||
host,
|
||||
port: 1421,
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user