mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
fix: electron-vite setting
Co-authored-by: Su-Yong <simssy2205@gmail.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { defineConfig, defineViteConfig } from 'electron-vite';
|
||||
import builtinModules from 'builtin-modules';
|
||||
@ -10,6 +10,11 @@ import pluginLoader from './vite-plugins/plugin-loader';
|
||||
|
||||
import type { UserConfig } from 'vite';
|
||||
|
||||
const resolveAlias = {
|
||||
'@': resolve(__dirname, './src'),
|
||||
'@assets': resolve(__dirname, './assets'),
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
main: defineViteConfig(({ mode }) => {
|
||||
const commonConfig: UserConfig = {
|
||||
@ -35,10 +40,7 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'@assets': fileURLToPath(new URL('./assets', import.meta.url)),
|
||||
},
|
||||
alias: resolveAlias,
|
||||
},
|
||||
};
|
||||
|
||||
@ -81,10 +83,7 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'@assets': fileURLToPath(new URL('./assets', import.meta.url)),
|
||||
},
|
||||
alias: resolveAlias,
|
||||
},
|
||||
};
|
||||
|
||||
@ -129,10 +128,7 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'@assets': fileURLToPath(new URL('./assets', import.meta.url)),
|
||||
},
|
||||
alias: resolveAlias,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -363,7 +363,7 @@ async function createMainWindow() {
|
||||
}, 600);
|
||||
}
|
||||
|
||||
app.on('render-process-gone', (event, webContents, details) => {
|
||||
app.on('render-process-gone', (_event, _webContents, details) => {
|
||||
showUnresponsiveDialog(win, details);
|
||||
});
|
||||
|
||||
@ -431,7 +431,7 @@ async function createMainWindow() {
|
||||
return win;
|
||||
}
|
||||
|
||||
app.once('browser-window-created', (event, win) => {
|
||||
app.once('browser-window-created', (_event, win) => {
|
||||
if (config.get('options.overrideUserAgent')) {
|
||||
// User agents are from https://developers.whatismybrowser.com/useragents/explore/
|
||||
const originalUserAgent = win.webContents.userAgent;
|
||||
|
||||
Reference in New Issue
Block a user