I recently created a React component library using RollupJS (2.7) and TypeScript (3.9.10), and I encountered an issue with circular dependencies being reported:
>> yarn build
(!) Circular dependency
src/index.ts -> src/components/index.ts -> src/components/Button/index.ts -> src/components/Button/Button.tsx -> src/index.ts
Despite the circular dependencies, the build process still manages to complete:
created ./dist/index.esm.js, ./dist/index.js in 4.3s
I searched through the tsconfig and rollup.config.js documentation for any configuration changes that could help address circular dependencies, but found none.
Is there a way to configure the tools (such as tsconfig or rollup.config) to automatically fail the build if a circular dependency is detected?