Explicitly exclude files from tailwind content config option
#12892
-
|
I would like to exclude all My tailwind content config: content: ['./src/**/*.{html,js,svelte,ts}']Ideally, I'd like to specify this from my tailwind plugin or preset, so without changing the content config in the original config file. Glad for any help on this! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
You can do in your Tailwind content config: content: [
'./src/**/*.{html,js,svelte,ts}',
'!./src/**/*.tdc.ts',
],But I assume this does not satisfy the stipulation of "without changing the content config in the original config file". You can try adding it to the a Tailwind Plugin's default configuration, but I'm not sure if the merging logic works here: plugin(
( … ) => {
…
},
{
content: [
'!./src/**/*.tdc.ts',
],
},
);And defining the negative file glob in a preset would not work either since it is replaced by the |
Beta Was this translation helpful? Give feedback.
You can do in your Tailwind content config:
But I assume this does not satisfy the stipulation of "without changing the content config in the original config file".
You can try adding it to the a Tailwind Plugin's default configuration, but I'm not sure if the merging logic works here:
And defining the negative file glob in a preset would not work either since it is replaced by the
contentin your Tailwind configuration.