Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,23 @@ export async function getStylesConfig(wco: WebpackConfigOptions): Promise<Config
extraPostcssPlugins.push(require(tailwindPackagePath)({ config: tailwindConfigPath }));
}
}
// Check for tailwind V4
// Tailwind V4 uses the new `@tailwindcss/postcss` package
try {
const tailwindPostCSSPackagePath = require.resolve('@tailwindcss/postcss', { paths: [root] });
try {
require.resolve('tailwindcss', { paths: [root] });
// Tailwind V4 is installed, add the plugin
extraPostcssPlugins.push(require(tailwindPostCSSPackagePath)());
} catch {
logger.warn(
`The '@tailwindcss/postcss' package is installed but the 'tailwindcss' package is not installed.` +
` To enable Tailwind CSS, please install the 'tailwindcss' package.`,
);
}
} catch {
// Tailwind V4 is not installed, no further action is needed
}

const autoprefixer: typeof import('autoprefixer') = require('autoprefixer');

Expand Down