Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support multiple build configs #275

Merged
merged 6 commits into from
Jul 18, 2023

Conversation

patzick
Copy link
Contributor

@patzick patzick commented Jun 29, 2023

closes #245

There are no breaking changes, and no action is required on the upgrade.

This change allows to have multiple build configurations in unbuild.config file. This is very much needed if you have different entry points and want separate flows for them or even a single entry point but a few different outcomes.

so basically you can do:

export default defineBuildConfig([
  {
    // ... first config
  },
  {
    // ... second config
  },
]);

or still do

export default defineBuildConfig({
  // ... single config like it is now
});

Short description of changes:

  • beginning of the build command has been extracted to read multiple configurations. These configurations are merged the same way they were and run one after another, with the rest of the code moved to an internal singleConfigBuild build. This way API of the package is not changing
  • hooks are merged so we can simplify their registration
  • fixture example is updated to show a simple use case

@patzick
Copy link
Contributor Author

patzick commented Jul 5, 2023

hey @pi0 :) Could you take a look here?
It would be great if that could be released soon 🤗

@pi0
Copy link
Member

pi0 commented Jul 5, 2023

Hi dear @patzick rest assured it is definitely on my todo list to be moved forward ASAP 👍🏼 Sorry the review took long.

@pi0 pi0 self-requested a review July 5, 2023 19:57
@pi0 pi0 self-assigned this Jul 5, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks 💯

@pi0 pi0 merged commit 1adcf70 into unjs:main Jul 18, 2023
This was referenced Jul 18, 2023
@patzick patzick deleted the feat/support-multiple-build-configs branch August 23, 2023 12:11
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.

Support Array BuildConfig
2 participants