diff --git a/vite.base.config.ts b/vite.base.config.ts index 9a215b63..948703b9 100644 --- a/vite.base.config.ts +++ b/vite.base.config.ts @@ -2,7 +2,7 @@ import { builtinModules } from 'node:module'; import type { ConfigEnv, Plugin, UserConfig } from 'vite'; import pkg from './package.json'; -export const builtins = ['electron', ...builtinModules.map((m) => [m, `node:${m}`]).flat()]; +export const builtins = ['electron', ...builtinModules.flatMap((m) => [m, `node:${m}`])]; export const external = [ ...builtins, diff --git a/vite.preload.config.ts b/vite.preload.config.ts index 11ae331b..2fbb774b 100644 --- a/vite.preload.config.ts +++ b/vite.preload.config.ts @@ -1,4 +1,4 @@ -import type { ConfigEnv, UserConfig } from 'vite'; +import type { UserConfig } from 'vite'; import { defineConfig, mergeConfig } from 'vite'; import { getBuildConfig, external } from './vite.base.config'; diff --git a/vite.types.config.ts b/vite.types.config.ts index 76fa6c80..c68df3d6 100644 --- a/vite.types.config.ts +++ b/vite.types.config.ts @@ -1,11 +1,11 @@ import { defineConfig } from 'vite'; import dts from 'vite-plugin-dts'; -import { resolve } from 'path'; +import path from 'node:path'; export default defineConfig({ build: { lib: { - entry: resolve(__dirname, 'src/main_types.ts'), + entry: path.resolve(import.meta.dirname, 'src/main_types.ts'), name: 'comfyui-electron-api', fileName: 'index', formats: ['es'],