From 10cad5368c1646f3d672cd174aa87a183cb9beaa Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 20 Apr 2021 09:56:15 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): set Tailwind CSS mode when using Tailwind Tailwind now suppports an environment variable named `TAILWIND_MODE` with possible values of `build` and `watch`. If the variable has not been set, the tooling will now set the variable based on the builder's `watch` option. --- .../angular_devkit/build_angular/src/webpack/configs/styles.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts b/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts index 288653c610a5..0404fcc88dd8 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts @@ -141,6 +141,9 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio ); } if (tailwindPackagePath) { + if (process.env['TAILWIND_MODE'] === undefined) { + process.env['TAILWIND_MODE'] = buildOptions.watch ? 'watch' : 'build'; + } extraPostcssPlugins.push(require(tailwindPackagePath)({ config: tailwindConfigPath })); } }