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

Add TAILWIND_TOUCH_ROOT env var for custom touch dir #152

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

chickencoder
Copy link
Contributor

This PR adds the ability to specify a custom root path for .tailwindcss touch files directory. This will enable special environments with file system restrictions (like serverless environments) to be able to configure where these touch files are written to.

I believe an option like this will be needed if the Tailwind Play project is updated to use JIT since it's deployed to Vercel. Vercel serverless functions can only write to the /tmp directory but in most other environments it makes most sense to put touch files in the $HOME directory.

@chickencoder chickencoder changed the title Add TAILWIND_TOUCH_DIR env var for custom touch dir Add TAILWIND_TOUCH_ROOT env var for custom touch dir Mar 24, 2021
@adamwathan
Copy link
Member

Bravo for even figuring out what was going on with this crap 😅 This looks good to me from what I understand but going to tag @bradlc for his opinion too!

@bradlc
Copy link
Contributor

bradlc commented Mar 24, 2021

Seems like a good idea! I would be tempted to use the env variable as the full path if it's defined, something like this:

const touchDir = process.env.TAILWIND_TOUCH_DIR || path.join(os.homedir() || os.tmpdir(), '.tailwindcss', 'touch')

This would give you more control over the exact path. What do you think?

@chickencoder
Copy link
Contributor Author

I agree that would be more flexible! Makes sense as long as there's no reason to preserve the '.tailwindcss' convention?

@bradlc
Copy link
Contributor

bradlc commented Mar 25, 2021

I agree that would be more flexible! Makes sense as long as there's no reason to preserve the '.tailwindcss' convention?

No, I don't think there's any reason to keep that if you are manually specifying a custom directory 👍

@adamwathan adamwathan merged commit 19ed602 into tailwindlabs:main Mar 26, 2021
@adamwathan
Copy link
Member

Thanks will get this out in a release soon! Hopefully we can just stop doing this crap altogether at some point 🥴

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.

3 participants