Skip to content

Commit a11f464

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 7a8686a commit a11f464

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

+3
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio
148148
);
149149
}
150150
if (tailwindPackagePath) {
151+
if (process.env['TAILWIND_MODE'] === undefined) {
152+
process.env['TAILWIND_MODE'] = buildOptions.watch ? 'watch' : 'build';
153+
}
151154
extraPostcssPlugins.push(require(tailwindPackagePath)({ config: tailwindConfigPath }));
152155
}
153156
}

0 commit comments

Comments
 (0)