-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate parsed content during module boot in production #1387
Comments
AFAIK there is two way to achieve this goal:
|
Can we at least, load all the raw files from the sources and store them? This way we can link to this directory for both dev and production, this is fine and faster as boot time and solve the CSS parsing issue for production for TailwindCSS |
Can you please explain more specifically what information from raw sources is needed? I think in order for tailwind styles to be discovered, we need raw content sources (accessible from the build-context storage instance) and a simpler parser that can parse/extract a list of components and used classes from markdown files to be provided to jits such as tailwind.. |
Basically we need the content from sources for TailwindCSS to analyse: https://github.com/nuxt/content/blob/main/src/module.ts#L548 The issue here is that the parsed content is available after the |
I see but I think unparsed markdowns pulled from storage sources should be also enough for a tailwind to match class usages right? |
I think tailwind has some issues with extracting classes from raw markdown files. /cc @Tahul |
Not it is working in dev, it's only because we don't have the content in production that is fails. |
As I checked tailwind build happens before nitro create/init, therefore we can't use The solution is to create a storage instance in |
Instead of adding the
/api/_content/cache
route in pre-render.This way, Tailwind JIT (and others) will work.
The text was updated successfully, but these errors were encountered: