angular-cli: using tailwind with esbuild doesn't trigger reload of styles

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I setup a bare minimum angular project using css (also tried scss but no different), and follow the guide here https://tailwindcss.com/docs/guides/angular

using webpack ng serve will correctly handle changes when changing any components class such as class="bg-white text-blue"

But If I then switch to the new esbuild version by changing angular.json to @angular-devkit/build-angular:browser-esbuild The browser reloads, but the tailwind css is not getting updated. If I stop ng serve and start up again the changes are there.

Has anyone else got esbuild and tailwind working well together?

Minimal Reproduction

  • pnpx @angular/cli new --routing --standalone --strict --style=css --view-encapsulation=None --package-manager=pnpm myapp
  • follow https://tailwindcss.com/docs/guides/angular
  • change angular.json to use @angular-devkit/build-angular:browser-esbuild for serve executor
  • change the app.component.html to contain some tailwind classes

Here is a reproduction repo https://github.com/leon/bug-angular-esbuild-tailwind

Exception or Error

No response

Your Environment

Angular CLI: 16.1.0
Node: 18.15.0
Package Manager: pnpm 8.6.0
OS: darwin arm64

Angular: 16.1.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1601.0
@angular-devkit/build-angular   16.1.0
@angular-devkit/core            16.1.0
@angular-devkit/schematics      16.1.0
@angular/cli                    16.1.0
@schematics/angular             16.1.0
rxjs                            7.8.1
typescript                      5.1.3

Anything else relevant?

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@clydin Since this is not resolved can you please reopen the issue 😃

@leon Good to hear. Thank you for testing it.

@clydin @princemaple In 16.1.3 it works 🥇