This repository demonstrates how to generate a static copy of Tailwind's configuration at build time using Vite's virtual module feature with proper TypeScript types. It serves as an alternative to the babel-plugin-preval
or using Tailwind's resolveConfig
helper directly.
Originally discovered here: Making Your Tailwind Config Available to Your Entire Application with Vite
The resolveConfig
helper has been removed. Configuration variables can now only be accessed at runtime via window.getComputedStyle()
. Refer to the official migration guide for more details.