mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Remove the Electron version
This commit is contained in:
+2
-41
@@ -1,7 +1,6 @@
|
||||
import { defineConfig, PluginOption } from "vite";
|
||||
import { createHtmlPlugin } from "vite-plugin-html";
|
||||
import autoprefixer from "autoprefixer";
|
||||
import electron from "vite-plugin-electron/simple";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
@@ -10,7 +9,7 @@ import { optimizeCssModules } from './plugins/optimizeCssModules';
|
||||
import { optimizeSvg } from './plugins/optimizeSvg';
|
||||
|
||||
const currentDir = path.resolve(__dirname);
|
||||
const outDir = process.env.VITE_ELECTRON ? `${currentDir}/build/electron` : `${currentDir}/build/normal`;
|
||||
const outDir = `${currentDir}/build/normal`;
|
||||
|
||||
const plugins: PluginOption[] = [
|
||||
react({
|
||||
@@ -42,34 +41,6 @@ const plugins: PluginOption[] = [
|
||||
})
|
||||
]
|
||||
|
||||
if (process.env.VITE_ELECTRON) {
|
||||
plugins.push(
|
||||
electron({
|
||||
main: {
|
||||
entry: "src/electron/main.ts",
|
||||
vite: {
|
||||
build: {
|
||||
outDir: `${outDir}/core`
|
||||
}
|
||||
}
|
||||
},
|
||||
preload: {
|
||||
input: "src/electron/preload.ts",
|
||||
vite: {
|
||||
build: {
|
||||
outDir: `${outDir}/core`
|
||||
}
|
||||
}
|
||||
},
|
||||
renderer: {},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const apiProxyTarget = process.env.VITE_API_BASE_URL?.startsWith("http")
|
||||
? process.env.VITE_API_BASE_URL
|
||||
: "http://127.0.0.1:8300";
|
||||
|
||||
export default defineConfig({
|
||||
root: path.resolve(__dirname, "src"),
|
||||
envDir: currentDir,
|
||||
@@ -80,20 +51,10 @@ export default defineConfig({
|
||||
"@fromchat/protocol": path.resolve(__dirname, "./src/protocol/index.ts")
|
||||
}
|
||||
},
|
||||
// Dev entry on 8301: browser uses same-origin `/api` (HTTP + WebSocket, e.g. `/api/chat/ws`).
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 8301,
|
||||
strictPort: true,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: apiProxyTarget,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
ws: true,
|
||||
proxyTimeout: 0,
|
||||
}
|
||||
},
|
||||
allowedHosts: ["beta.fromchat.ru"]
|
||||
},
|
||||
appType: "spa",
|
||||
@@ -125,4 +86,4 @@ export default defineConfig({
|
||||
chunkSizeWarningLimit: 1024
|
||||
},
|
||||
cacheDir: `${currentDir}/build/cache`
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user