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

fix(core): enable details for analyzer #3021

Merged
merged 10 commits into from Aug 25, 2023
Merged

Conversation

enkot
Copy link
Contributor

@enkot enkot commented Aug 22, 2023

#2682

Currently Analyzer shows incorrect info, because config.details is disabled by default.

@enkot enkot requested a review from antfu as a code owner August 22, 2023 18:01
@netlify
Copy link

netlify bot commented Aug 22, 2023

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 56b9412
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/64e87867ce585100086eb4c4
😎 Deploy Preview https://deploy-preview-3021--unocss.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 configuration.

@antfu
Copy link
Member

antfu commented Aug 23, 2023

I don't actually mind turning details on by default on dev mode. This PR's implementation feels a bit verbose and duplicated

@enkot
Copy link
Contributor Author

enkot commented Aug 23, 2023

But in this case user will be able to break the Analyzer by setting "details: false" in config.

@@ -157,6 +158,7 @@ export function resolveConfig<Theme extends object = object>(
extractors,
safelist: getMerged('safelist'),
separators,
details: config.details ?? process.env.NODE_ENV === 'development',
Copy link
Member

Choose a reason for hiding this comment

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

The core is env agnostic, we shouldn't rely on process. Might be better to rely on envMode and move this logics to the vite/webpack plugin

@enkot
Copy link
Contributor Author

enkot commented Aug 23, 2023

@antfu 3rd attempt :)

@antfu antfu enabled auto-merge August 25, 2023 09:46
@antfu antfu added this pull request to the merge queue Aug 25, 2023
Merged via the queue into unocss:main with commit 29e53de Aug 25, 2023
10 checks passed
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.

None yet

2 participants