mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-08-31 11:21:55 +08:00
use vite-plugin-optimizer instead vite-plugin-resolve
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { builtinModules } from 'module'
|
||||
import { defineConfig, Plugin } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import resolve from 'vite-plugin-resolve'
|
||||
import optimizer from 'vite-plugin-optimizer'
|
||||
import pkg from '../../package.json'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
@@ -41,16 +41,16 @@ export default defineConfig({
|
||||
* @see https://github.com/caoxiemeihao/electron-vue-vite/issues/52
|
||||
*/
|
||||
export function resolveElectron(
|
||||
resolves: Parameters<typeof resolve>[0] = {}
|
||||
entries: Parameters<typeof optimizer>[0] = {}
|
||||
): Plugin {
|
||||
const builtins = builtinModules.filter((t) => !t.startsWith('_'))
|
||||
/**
|
||||
* @see https://github.com/caoxiemeihao/vite-plugins/tree/main/packages/resolve#readme
|
||||
*/
|
||||
return resolve({
|
||||
return optimizer({
|
||||
electron: electronExport(),
|
||||
...builtinModulesExport(builtins),
|
||||
...resolves,
|
||||
...entries,
|
||||
})
|
||||
|
||||
function electronExport() {
|
||||
|
Reference in New Issue
Block a user