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(transformer-directives): enforce pre by default #1923

Merged
merged 1 commit into from Nov 29, 2022

Conversation

sibbng
Copy link
Member

@sibbng sibbng commented Nov 27, 2022

Fixes #1849

In production builds Nuxt's cssnano plugin applied before unocss plugin. Its mergeRules optimization causes problems with at-rules. My previous solution was disabling mergeRules by adding the following lines to @unocss/nuxt module. But that's not ideal since it affects minifying:

    if (nuxt.options.postcss.plugins.cssnano) {
      const preset = nuxt.options.postcss.plugins.cssnano.preset
      nuxt.options.postcss.plugins.cssnano = {
        preset: [preset?.[0] || 'default', Object.assign(
          preset?.[1] || {}, { mergeRules: false },
        )],
      }
    }

@netlify
Copy link

netlify bot commented Nov 27, 2022

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit eaed181
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/63835404e15cc20008994058
😎 Deploy Preview https://deploy-preview-1923--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 settings.

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.

Nuxt3 - @apply directives in <style> not correctly parsed in production
3 participants