Skip to content

feat(vite-config): forward extra Vite config to base package config#137

Merged
WybeBosch merged 2 commits into
mainfrom
feat/vite-config-forward-extra-config
Jun 19, 2026
Merged

feat(vite-config): forward extra Vite config to base package config#137
WybeBosch merged 2 commits into
mainfrom
feat/vite-config-forward-extra-config

Conversation

@WybeBosch

@WybeBosch WybeBosch commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

createBasePackageConfig vangt nu onbekende opties op via ...restConfig en merged die met mergeConfig op de gegenereerde config.

Waarom

We dachten dat dit al werkte, maar extra opties (zoals resolve) werden nooit doorgegeven aan de uiteindelijke config, nu worden ze wel meegenomen.

Hoe gebruik je het

npmPackageConfig( {
  entryPoints: { 'brave-frontend-kit': 'src/index.ts' },
  resolve: { alias: { '@modules': '…' } },
} );

Hoe de data stroomt

vite.config.js  ──►  npm-package.js  ──►  base-package.js
  resolve: {…}        ...options            ...restConfig  ──►  mergeConfig()

resolve reist als gewone optie door drie bestanden:

  1. vite.config.js (consumer) — roept npmPackageConfig( { entryPoints, resolve } ) aan.
  2. configs/npm-package.jsnpmPackageConfig spreidt ...options (incl. resolve) door naar createBasePackageConfig.
  3. configs/base-package.jscreateBasePackageConfig pakt de benoemde opties eruit; resolve valt in ...restConfig en wordt via mergeConfig( baseConfig, restConfig ) in de uiteindelijke config gemerged.

Capture unknown options passed to createBasePackageConfig as restConfig
and deep-merge them onto the generated config via mergeConfig. This lets
consumers pass standard Vite options (e.g. resolve.alias, server) directly
to npmPackageConfig instead of wrapping them in a custom plugin.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables createBasePackageConfig (and therefore npmPackageConfig / laravelPackageConfig) to accept and apply additional standard Vite config keys by capturing unknown options and deep-merging them onto the generated base config via Vite’s mergeConfig.

Changes:

  • Import mergeConfig from vite and use it to merge extra user-supplied config into the generated base package config.
  • Collect unrecognized options passed to createBasePackageConfig as ...restConfig and forward them into the returned Vite config.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@WybeBosch WybeBosch force-pushed the feat/vite-config-forward-extra-config branch from e28ff4f to 2507bde Compare June 19, 2026 08:45
@WybeBosch WybeBosch merged commit 17d449a into main Jun 19, 2026
2 checks passed
@WybeBosch WybeBosch deleted the feat/vite-config-forward-extra-config branch June 19, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants