Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plugin-vite): necessary forge config options
Browse files Browse the repository at this point in the history
caoxiemeihao authored and BlackHole1 committed Jul 8, 2024
1 parent 5880756 commit a0148b5
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/plugin/vite/src/Config.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
2 changes: 1 addition & 1 deletion packages/plugin/vite/src/config/vite.main.config.ts
Original file line number Diff line number Diff line change
@@ -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'],
},
2 changes: 1 addition & 1 deletion packages/plugin/vite/src/config/vite.preload.config.ts
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit a0148b5

Please sign in to comment.