Skip to content

Commit ff02842

Browse files
clydinjosephperrott
authored andcommitted
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 2ac73c7)
1 parent 843a848 commit ff02842

File tree

1 file changed

+3
-0
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+3
-0
lines changed

packages/angular_devkit/build_angular/src/webpack/configs/styles.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
186186
);
187187
}
188188
if (tailwindPackagePath) {
189+
if (process.env['TAILWIND_MODE'] === undefined) {
190+
process.env['TAILWIND_MODE'] = buildOptions.watch ? 'watch' : 'build';
191+
}
189192
extraPostcssPlugins.push(require(tailwindPackagePath)({ config: tailwindConfigPath }));
190193
}
191194
}

0 commit comments

Comments
 (0)