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 1 commit into from Nov 29, 2022


Copy link

@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 },

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
😎 Deploy Preview
📱 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
None yet
None yet

Successfully merging this pull request may close these issues.

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