Giter Site home page Giter Site logo

Comments (3)

aackerman avatar aackerman commented on June 21, 2024

Yea, I would imagine you would use the exclude regex option. There is an example in the README. Please let me know if that isn't enough information to solve this issue.

from circular-dependency-plugin.

renehamburger avatar renehamburger commented on June 21, 2024

Yes, I could suppress the warning/error manually for circular dependencies that are not problematic. But my point is that the warning/error shouldn't be there in the first place if the circular dependency chain can be resolved by webpack, i.e., if one of the modules can be loaded because it requires it's successor after it has been loaded completely. Do you see what I mean?

from circular-dependency-plugin.

aackerman avatar aackerman commented on June 21, 2024

If I understand you correctly, you expect your code to not error. But you would expect something like the following to error.

const b = require('b');
export class a;
let a;
class b {
  constructor() {
    a = require('a');
    new a();
  }
}
new b();
export b; 

That type of static analysis is not something that can not be provided by this tool. Webpack itself analyzes import and require calls to build a dependency graph and construct a module bundle, it doesn't do any analysis of runtime semantics and this tool doesn't either.

The best this tool can do is identifying circular dependencies, which might identify a problem but requires a human to do further analysis.

I personally don't believe that a tool for JavaScript exists that could error in the way you would expect. Sorry to say I cannot provide this functionality.

from circular-dependency-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.