Skip to content

Explicitly exclude files from tailwind content config option #12892

Answered by wongjn
benjaminpreiss asked this question in Help
Discussion options

You must be logged in to vote

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 content in your Tailwind configuration.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@benjaminpreiss
Comment options

@wongjn
Comment options

@benjaminpreiss
Comment options

@heymartinadams
Comment options

@bitttttten
Comment options

Answer selected by benjaminpreiss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants