Revert vite build
This commit is contained in:
@@ -27,16 +27,15 @@ const winEvent = () => {
|
||||
|
||||
export const createWindow = async(userApi: LX.UserApi.UserApiInfo) => {
|
||||
await closeWindow()
|
||||
dir ??= process.env.NODE_ENV !== 'production' ? path.join(__USER_API_PATH__, 'renderer') : encodePath(__dirname)
|
||||
dir ??= process.env.NODE_ENV !== 'production' ? webpackUserApiPath : path.join(encodePath(__dirname), 'userApi')
|
||||
|
||||
if (!html) {
|
||||
html = await fs.promises.readFile(path.join(dir, 'user-api.html'), 'utf8')
|
||||
html = await fs.promises.readFile(path.join(dir, 'renderer/user-api.html'), 'utf8')
|
||||
}
|
||||
const preloadUrl = process.env.NODE_ENV !== 'production'
|
||||
? `${path.join(encodePath(__dirname), '../dist/user-api-preload.js')}`
|
||||
: `${path.join(encodePath(__dirname), '../preload/user-api-preload.js')}`
|
||||
|
||||
// console.log(preloadUrl, html)
|
||||
: `${path.join(encodePath(__dirname), 'user-api-preload.js')}`
|
||||
// console.log(preloadUrl)
|
||||
|
||||
/**
|
||||
* Initial window options
|
||||
|
||||
@@ -139,7 +139,7 @@ export const createWindow = () => {
|
||||
},
|
||||
})
|
||||
|
||||
const winURL = process.env.NODE_ENV !== 'production' ? 'http://localhost:9081' : `file://${path.join(encodePath(__dirname), '../renderer-lyric/index.html')}`
|
||||
const winURL = process.env.NODE_ENV !== 'production' ? 'http://localhost:9081/lyric.html' : `file://${path.join(encodePath(__dirname), 'lyric.html')}`
|
||||
void browserWindow.loadURL(winURL + `?dark=${shouldUseDarkColors}&theme=${encodeURIComponent(JSON.stringify(theme))}`)
|
||||
|
||||
winEvent()
|
||||
|
||||
@@ -87,7 +87,6 @@ export const watchConfigKeys = [
|
||||
export const buildLyricConfig = (appSetting: Partial<LX.AppSetting>): Partial<LX.DesktopLyric.Config> => {
|
||||
const setting: Partial<LX.DesktopLyric.Config> = {}
|
||||
for (const key of watchConfigKeys) {
|
||||
// @ts-expect-error
|
||||
if (key in appSetting) setting[key] = appSetting[key]
|
||||
}
|
||||
return setting
|
||||
|
||||
@@ -99,7 +99,7 @@ export const createWindow = () => {
|
||||
}
|
||||
browserWindow = new BrowserWindow(options)
|
||||
|
||||
const winURL = process.env.NODE_ENV !== 'production' ? 'http://localhost:9080' : `file://${path.join(encodePath(__dirname), '../renderer/index.html')}`
|
||||
const winURL = process.env.NODE_ENV !== 'production' ? 'http://localhost:9080' : `file://${path.join(encodePath(__dirname), 'index.html')}`
|
||||
void browserWindow.loadURL(winURL + `?dt=${!!global.envParams.cmdParams.dt}&dark=${shouldUseDarkColors}&theme=${encodeURIComponent(JSON.stringify(theme))}`)
|
||||
|
||||
winEvent()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createInflate, constants as zlibConstants } from 'node:zlib'
|
||||
import path from 'node:path'
|
||||
// import path from 'path'
|
||||
import { mainHandle } from '@common/mainIpc'
|
||||
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames'
|
||||
|
||||
@@ -40,7 +40,7 @@ const handleDecode = async(lrc: string, tlrc: string, rlrc: string) => {
|
||||
// const nativeBindingPath = path.join(__dirname, '../build/Release/qrc_decode.node')
|
||||
// const nativeBindingPath = process.env.NODE_ENV !== 'production' ? path.join(__dirname, '../build/Release/qrc_decode.node')
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const addon = require(path.join(__QRC_DECODE_NODE_PATH__, 'qrc_decode.node'))
|
||||
const addon = require('qrc_decode.node')
|
||||
// console.log(addon)
|
||||
qrc_decode = addon.qrc_decode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user