Closed mikemand closed 4 years ago
I should note that if you don't opt to go with Tailwind's purge, we need to set purge: false
in the config to prevent this warning:
I like it and am happy for it to be merged 👍 It makes sense to use the built-in tool rather than relying on another dependency that does the same.
Instead of putting it on the end developer to set up their directories, we could implement the sensible defaults from the underlying package we're already using: https://github.com/spatie/postcss-purgecss-laravel/blob/master/src/defaultConfig.js
{
content: [
"app/**/*.php",
"resources/**/*.html",
"resources/**/*.js",
"resources/**/*.jsx",
"resources/**/*.ts",
"resources/**/*.tsx",
"resources/**/*.php",
"resources/**/*.vue",
"resources/**/*.twig",
],
defaultExtractor: (content) => content.match(/[\w-/.:]+(?<!:)/g) || [],
whitelistPatterns: [/-active$/, /-enter$/, /-leave-to$/, /show$/],
}
Tailwind's built-in purging only runs when the environment is set to production (ie. you run npm run prod
) anyway - so will be fine during development, and behave the same as the preset currently does.
I agree and I think this is a sensible default. If a developer doesn't need/use something they are free to remove it from this config file after it has been published. Uploading the requested changes now. 👍
Oh, I also removed my example from the README, since the config file itself is now a pretty extensive example.
Nice work!
Hi Dan & Liam,
Thank you! I'm really excited to use this preset for any future TALL stack projects.
I don't know if this is something that anyone wants to do because it is incredibly opinionated, but I thought I would PR it anyway.
Tailwind v1.4 has PurgeCSS built-in now, so it's not strictly necessary we use Spatie's package. However, I know Tailwind's implementation does not automatically set up all the directories to scan.
This package will put the burden on the end developer to manage their own directories, but I can foresee an increase in tickets here because "CSS classes are missing".
If there are no objections, I will mark the PR as ready for review so it can be merged. Otherwise, we can close this PR.