Skip to content

Commit c5c3705

Browse files
authored
feat(angular-rspack): include js-based postcss config (#120)
1 parent b8e57af commit c5c3705

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/angular-rspack/src/lib/utils/postcss-configuration.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface RawPostcssConfiguration {
2222
const postcssConfigurationFiles: string[] = [
2323
'postcss.config.json',
2424
'.postcssrc.json',
25+
'postcss.config.js',
2526
];
2627
const tailwindConfigFiles: string[] = [
2728
'tailwind.config.js',
@@ -88,7 +89,9 @@ export async function loadPostcssConfiguration(
8889
return undefined;
8990
}
9091

91-
const raw = await readPostcssConfiguration(configPath);
92+
const raw = configPath.endsWith('.js')
93+
? require(configPath)
94+
: await readPostcssConfiguration(configPath);
9295

9396
// If no plugins are defined, consider it equivalent to no configuration
9497
if (!raw.plugins || typeof raw.plugins !== 'object') {

0 commit comments

Comments
 (0)