Skip to content

Content configuration does not support exclude #8828

Closed

Description

@cheng93

What version of Tailwind CSS are you using?

3.1.5

What build tool (or framework if it abstracts the build tool) are you using?

Angular CLI

What version of Node.js are you using?

16.13.1

What browser are you using?

N/A

What operating system are you using?

Windows

Reproduction URL

https://github.com/cheng93/tailwind-exclude

  • pull the repository
  • run ng serve
  • make a change in the spec file (src/app/app.component.spec.ts)
  • you will see that the angular recompiles

Note when I changed content to [], meaning it should not detect any files, changes to the spec files, does not cause a recompile.
Thus I think the issue is with tailwind (or possibly upstream lib), rather than on Angular

Describe your issue

Using exclusion glob, I would expect changes in excluded files to not cause a rebuild.

{
  content: ["./src/**/!(*.spec).{html,ts}"]
}

Activity

  1. cheng93 commented on Jul 11, 2022

    @cheng93
    Author

    #5198

    I tried the solution described above (also in the repository), and it did not work as well

  2. thecrypticace commented on Jul 11, 2022

    @thecrypticace
    Contributor

    Unfortunately this is an issue with Angular's use of webpack as it only supports watching directories. We pass through a glob but it gets turned into a directory to be watched by webpack. I gave a bit more detailed response (including possible alternatives) in this issue about Gatsby — which also uses wepback: #8477 (comment)

    Apologies we can't do more about this but it's a tooling limitation outside our control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions