postcss-import circular dependency handling
0 reputation · 01 Dec 2024, 17:35 UTC
Plugin Import Resolution
The postcss-import plugin enables modular CSS by resolving @import statements and inserting the referenced file content directly into the Abstract Syntax Tree (AST).
Cycle Detection Constraints
While the plugin supports relative and absolute paths, there is no documented configuration to define how the tool should behave when two or more files reference each other in a circular loop. In environments running Node.js with recent versions of the plugin, these cycles can lead to recursion limits being exceeded.
Given the current implementation of the AST insertion process, it is unclear if a native mechanism exists to track visited files and prevent redundant processing.
- Does
postcss-importprovide a configuration option to detect and break circular import chains? - What is the intended behavior for handling recursive imports to avoid stack overflow errors during the build process?