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