question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

whitelist: transition classes

See original GitHub issue

Hey!

Currently I have to manually write white list like this: whitelist: [..., 'page-enter-active', 'page-leave-active', 'page-enter', 'page-leave-to', 'smooth-enter-active', 'smooth-leave-active', 'smooth-enter', 'smooth-leave-to', 'fade-enter-active', 'fade-leave-active', 'fade-enter', 'fade-leave-to' ...]

Is it possible to configure module for auto whitelisting transition classes which nuxt uses? If not, it would be super cool to get this functionality in the future)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
curtisbeltcommented, May 11, 2019

@koresar

Thank you for sharing that article, I am actually updating my config on a project now based on your post and that article!

I’m keeping nuxt-purgecss, I believe the config below is equivalent to what you posted. Note I updated router-link to nuxt-link.

// nuxt.config.js

module.exports = {
  purgeCSS: {
    mode: 'postcss',
    extractors: [
      {
        extractor: class {
          static extract(content) {
            return content.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || [];
          }
        }
      }
    ],
    whitelistPatterns: [
      /-(leave|enter|appear)(|-(to|from|active))$/,
      /^(?!(|.*?:)cursor-move).+-move$/,
      /^nuxt-link(|-exact)-active$/
    ]
  },
  build: {
    postcss: {
      preset: {
        stage: 0
      },
      plugins: {
        tailwindcss: './tailwind.js',
        autoprefixer: {}
      }
    }
  }
}
1reaction
manniLcommented, May 13, 2019

@willdante If you are using a postcss.config.js, autoprefixer won’t work as expected, so that can happen (see https://github.com/nuxt/nuxt.js/pull/5419)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defensive Driving Course 10th Edition - National Safety Council
NSC Defensive Driving Virginia 8-hour 10th Edition Transition is Under Way · Session 1 (3 hours): Principles of Teaching Defensive Driving · Session...
Read more >
nuxt-purgecss - npm
The whitelist now includes move transition classes. If you whitelisted these before, you can remove them. Test on your staging server (or ...
Read more >
1 Day to Whitelisting Mastery - Crash Course | CQURE Academy
“1 Day to Whitelisting Mastery” is an advanced course designed for cybersecurity professionals who have either completed CQURE's “30-Day Windows Security  ...
Read more >
Content Configuration - Tailwind CSS
Configuring source paths. Tailwind CSS works by scanning all of your HTML, JavaScript components, and any other template files for class names, ...
Read more >
Worrying about the Vase: Whitelisting - LessWrong
In latent space whitelisting, no longer do we constrain transitions based on class boundaries; instead, we penalize based on endpoint ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found