File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
packages/angular_devkit/build_angular/src/tools/webpack/configs Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,23 @@ export async function getStylesConfig(wco: WebpackConfigOptions): Promise<Config
9696 extraPostcssPlugins . push ( require ( tailwindPackagePath ) ( { config : tailwindConfigPath } ) ) ;
9797 }
9898 }
99+ // Check for tailwind V4
100+ // Tailwind V4 uses the new `@tailwindcss/postcss` package
101+ try {
102+ const tailwindPostCSSPackagePath = require . resolve ( '@tailwindcss/postcss' , { paths : [ root ] } ) ;
103+ try {
104+ require . resolve ( 'tailwindcss' , { paths : [ root ] } ) ;
105+ // Tailwind V4 is installed, add the plugin
106+ extraPostcssPlugins . push ( require ( tailwindPostCSSPackagePath ) ( ) ) ;
107+ } catch {
108+ logger . warn (
109+ `The '@tailwindcss/postcss' package is installed but the 'tailwindcss' package is not installed.` +
110+ ` To enable Tailwind CSS, please install the 'tailwindcss' package.` ,
111+ ) ;
112+ }
113+ } catch {
114+ // Tailwind V4 is not installed, no further action is needed
115+ }
99116
100117 const autoprefixer : typeof import ( 'autoprefixer' ) = require ( 'autoprefixer' ) ;
101118
You can’t perform that action at this time.
0 commit comments