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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't include css-vars-ponyfill chunk if not enabled #53

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

danielroe
Copy link
Contributor

@danielroe danielroe commented Feb 27, 2023

馃摎 Description

This is how you would ensure that you don't accidentally create a chunk if the user doesn't want the feature enabled. Accessing moduleOptions isn't ideal because it's not static enough for rollup or vite to know the value exists and never changes, and therefore be able to tree-shake out the contents of one-half of the if/else clause. So instead we can conditionally provide a helper file based on what the user option is.

Resolves #37.

馃摑 Checklist

  • All commits follow the Conventional Commit format
  • The PR's title follows the Conventional Commit format

@dargmuesli dargmuesli self-requested a review February 28, 2023 23:51
@dargmuesli
Copy link
Owner

You're amazing, Daniel! Thank you so much for showing how to do this. 鉂わ笍 I've really learned something 馃檹

@dargmuesli dargmuesli merged commit a9296c0 into dargmuesli:master Mar 1, 2023
@dargmuesli
Copy link
Owner

馃帀 This PR is included in version 5.0.1 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: don't include the css vars ponyfill in build when disabled
2 participants