Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

feat: allow custom extractors #125

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

kombucha
Copy link
Contributor

@kombucha kombucha commented Mar 20, 2021

I'm building a ui library using Tailwind which relies heavily on a custom purge extractor, which means I wouldn't be able to leverage tailwindcss-jit 😿 .

This PR aims to support custom extractors as defined in the purge config options if any, falling back to the default one from tailwindcss-jit.

I tried to make as few modifications as I could to the code

I'm hoping you're on board with the general idea 🙏

@kombucha kombucha changed the title feat: Allow custom extractors feat: allow custom extractors Mar 20, 2021
@kombucha kombucha force-pushed the allow-custom-extractors branch 3 times, most recently from 1dea69d to 092e067 Compare March 20, 2021 18:33
Comment on lines +6 to +7
jest.resetModules()
const tailwind = require('../src/index.js')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've noticed that the second test in that file would pass even when it shouldn't, as long as the first one passed. I think it's due to this module sharedState which survives across multiple call in the same process.

That's why I'm calling resetModules, which resets require's cache and gives me a fresh new instance on each run.

@adamwathan adamwathan merged commit 6a2ab24 into tailwindlabs:main Mar 23, 2021
@adamwathan
Copy link
Member

This is great thanks so much! Going to play with it a bit and hopefully get it out in a release today for people to play with 👍🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants