From a11f4644861616f7d0929e62ae9833e795dd8649 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. (cherry picked from commit 2ac73c75e7c88aa26736423e5b26c69a426c5394) --- .../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 c789d5505df8..1af53b2b913a 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts @@ -148,6 +148,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 })); } }