mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
refactor(desktop): replace resolve-env with build-time dotenv injection
This commit is contained in:
parent
14b561bc39
commit
c8d6883474
7 changed files with 27 additions and 88 deletions
|
|
@ -1,6 +1,9 @@
|
|||
import { build } from 'esbuild';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
const desktopEnv = dotenv.config().parsed || {};
|
||||
|
||||
const STANDALONE_ROOT = path.join(
|
||||
'..', 'surfsense_web', '.next', 'standalone', 'surfsense_web'
|
||||
|
|
@ -104,6 +107,11 @@ async function buildElectron() {
|
|||
external: ['electron'],
|
||||
sourcemap: true,
|
||||
minify: false,
|
||||
define: {
|
||||
'process.env.HOSTED_FRONTEND_URL': JSON.stringify(
|
||||
desktopEnv.HOSTED_FRONTEND_URL || 'https://surfsense.net'
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
await build({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue