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: respect esbuild minify config for css #8811

Merged
merged 3 commits into from Jun 27, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jun 27, 2022

Description

FIx #6065

Additional context

Make sure CSS minify respects minify* options too.

Also changed how minify* options take precedence when resolving the final minify options. Since build.minify is true by default, if the user sets any of minify* options (!= null), use those options instead. Since it's "any of" the options, those that are actually null would be defaulted to true


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added feat: css p2-nice-to-have Not breaking anything but nice to have (priority) labels Jun 27, 2022
@netlify
Copy link

netlify bot commented Jun 27, 2022

Deploy Preview for vite-docs-main ready!

Name Link
🔨 Latest commit fd1281b
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b94cfb9e0ab20008a37b19
😎 Deploy Preview https://deploy-preview-8811--vite-docs-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

minify: true,
target: config.build.cssTarget || undefined
target: config.build.cssTarget || undefined,
...resolveEsbuildMinifyOptions(config.esbuild || {})
Copy link
Member Author

Choose a reason for hiding this comment

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

It might be nicer if we could pre-compute this somewhere, but I can't find a good spot to put without making the flow a bit awkward. Perhaps it's fine with V8

@patak-dev patak-dev merged commit d90409e into vitejs:main Jun 27, 2022
@bluwy bluwy deleted the feat-respect-esbuild-minify-for-css branch June 27, 2022 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: css p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vite.config.js esbuild options are ignored, e.g. disabling minification or one of its aspects
3 participants