orindholt
orindholt

Reputation: 113

Angular tailwind utilities working fine in development, but not in production

When I build my Angular project I only sometimes get "No utility classes were detected in your source files." using tailwind, and sometimes it builds without warning but still no utilities. This happened all of a sudden, being built many times before, with working utilities. The base tailwind reset gets implemented in the styles, but not utilities..
It's also worth mentioning that classes i build from the styles with @apply works fine.

tailwind.config.js:

content: ["./src/**/*.{html,ts}"],

build command:

ng build --output-path docs

included in styles.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

Upvotes: 0

Views: 1131

Answers (1)

orindholt
orindholt

Reputation: 113

A coworker found a solution to this. For some unknown reason you have to include multiple file extensions to the tailwind config content string, even if they aren't used.

content: ["./src/**/*.{html,ts,tsx,jsx}"],

Upvotes: 3

Related Questions