Skip to content

Commit

Permalink
feat: Update tailwind regex
Browse files Browse the repository at this point in the history
  • Loading branch information
anantoghosh committed Mar 23, 2020
1 parent 42c7642 commit 791c06a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,11 @@ export function onCreateWebpackConfig(
};

if (userOptions.tailwind) {
userOptions.extractors = [
{
extractor:
/**
* @param {string} content
*/
content => content.match(/[A-Za-z0-9-_:\/]+/g) || [],
extensions: ['js', 'ts', 'jsx', 'tsx', 'md', 'mdx']
},
...userOptions.extractors
];
userOptions.defaultExtractor =
/**
* @param {string} content
*/
content => content.match(/[\w-/:]+(?<!:)/g) || [];
}

if (userOptions.rejected && stage === 'build-html') {
Expand Down

0 comments on commit 791c06a

Please sign in to comment.