Skip to content

Detect circular dependencies (and avoid them) #78

@caesarsol

Description

@caesarsol

Is your feature request related to a problem? Please describe.

Sometimes circular dependencies are introduced in the project. Often without knowing, maybe for simple exported strings or trivial constants.
This introduces these possible problems:

  • webpack always refreshes the page, instead of using Hot Module Replacement;
  • some imports fail with no error, and the variable being imported results null or undefined;
  • TypeScript crazies put and laptop goes BOOOM.

Describe the solution you'd like

Add circular-dependency-plugin to Webpack by default, to error out (or a BIG warning, but I prefer error) in case of a circular dependency.

Related project: madge

cc @ivanross (for problem 3 and for the discovery of madge)
cc @pitou (for problem 2)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions