forked from OctoWoW/OctoLauncher
5dca94a3fc
Manifest-based CDN updater and mod manager for the OctoWoW 1.12.1 client: launcher-owned realmlist, torrent-backed content sync with bundled aria2c, antivirus and Defender exclusion handling, hardware-aware render distance, optional client tweaks and mods, and the in-launcher news feed.
37 lines
842 B
TypeScript
37 lines
842 B
TypeScript
import { resolve } from 'path';
|
|
|
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { loadEnv } from 'vite';
|
|
|
|
const alias = {
|
|
'~common': resolve('src/common'),
|
|
'~main': resolve('src/main'),
|
|
'~renderer': resolve('src/renderer'),
|
|
'~build': resolve('build')
|
|
};
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
if (mode === 'ptr') {
|
|
const realm = loadEnv(mode, process.cwd(), 'MAIN_VITE_')
|
|
.MAIN_VITE_PTR_REALMLIST;
|
|
if (!realm || realm === 'octowow.st')
|
|
throw new Error(
|
|
'PTR build needs MAIN_VITE_PTR_REALMLIST set to a non-prod realm host'
|
|
);
|
|
}
|
|
return {
|
|
main: {
|
|
resolve: { alias },
|
|
plugins: [externalizeDepsPlugin()]
|
|
},
|
|
preload: {
|
|
plugins: [externalizeDepsPlugin()]
|
|
},
|
|
renderer: {
|
|
resolve: { alias },
|
|
plugins: [react()]
|
|
}
|
|
};
|
|
});
|