diff --git a/packages/plugin/vite/src/Config.ts b/packages/plugin/vite/src/Config.ts index 52dfafd4ff..8aba1b9299 100644 --- a/packages/plugin/vite/src/Config.ts +++ b/packages/plugin/vite/src/Config.ts @@ -4,7 +4,7 @@ export interface VitePluginBuildConfig { /** * Alias of `build.lib.entry` in `config`. */ - entry?: LibraryOptions['entry']; + entry: LibraryOptions['entry']; /** * Vite config file path. */ @@ -20,7 +20,7 @@ export interface VitePluginRendererConfig { /** * Human friendly name of your entry point. */ - name?: string; + name: string; /** * Vite config file path. */ diff --git a/packages/plugin/vite/src/config/vite.main.config.ts b/packages/plugin/vite/src/config/vite.main.config.ts index ce7ccd1fc3..137e6ac4ff 100644 --- a/packages/plugin/vite/src/config/vite.main.config.ts +++ b/packages/plugin/vite/src/config/vite.main.config.ts @@ -8,7 +8,7 @@ export function getConfig(forgeEnv: ConfigEnv<'build'>): UserConfig { const config: UserConfig = { build: { lib: { - entry: forgeConfigSelf.entry!, + entry: forgeConfigSelf.entry, fileName: () => '[name].js', formats: ['cjs'], }, diff --git a/packages/plugin/vite/src/config/vite.preload.config.ts b/packages/plugin/vite/src/config/vite.preload.config.ts index 7f99bd5845..03e128d360 100644 --- a/packages/plugin/vite/src/config/vite.preload.config.ts +++ b/packages/plugin/vite/src/config/vite.preload.config.ts @@ -9,7 +9,7 @@ export function getConfig(forgeEnv: ConfigEnv<'build'>): UserConfig { rollupOptions: { external, // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`. - input: forgeConfigSelf.entry!, + input: forgeConfigSelf.entry, output: { format: 'cjs', // It should not be split chunks.