Skip to content

fix: default to building all targets when env.target is unset#131

Merged
willeastcott merged 1 commit intomainfrom
fix/rollup-default-target
Mar 8, 2026
Merged

fix: default to building all targets when env.target is unset#131
willeastcott merged 1 commit intomainfrom
fix/rollup-default-target

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

Summary

  • Default to building all Rollup targets (UMD, ESM, styles) when process.env.target is unset
  • Simplifies the switch by using optional chaining and a default case, removing the outer if guard

Details

Previously, running rollup -c without --environment target:... left targets as undefined, causing Rollup to receive no configuration. Now it falls through to the default case and builds everything, matching the behavior of target:all.

@willeastcott willeastcott force-pushed the fix/rollup-default-target branch from 5574e3f to f42d3a0 Compare March 8, 2026 12:53
@willeastcott willeastcott requested a review from Copilot March 8, 2026 12:54
@willeastcott willeastcott self-assigned this Mar 8, 2026
@willeastcott willeastcott added the enhancement New feature or request label Mar 8, 2026
@willeastcott willeastcott force-pushed the fix/rollup-default-target branch from f42d3a0 to f8d67fa Compare March 8, 2026 12:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Rollup configuration so running rollup -c without --environment target:... still produces a valid build by defaulting to all output targets, aligning the behavior with target:all.

Changes:

  • Replaces the outer if (process.env.target) guard with optional chaining in the switch.
  • Adds a default branch that builds all targets (UMD, ESM, styles) when process.env.target is unset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread rollup.config.mjs
@willeastcott willeastcott merged commit de00c59 into main Mar 8, 2026
2 checks passed
@willeastcott willeastcott deleted the fix/rollup-default-target branch March 8, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants