question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Option to exclude dynamic imports

See original GitHub issue

Now that dynamic import support is in, it’d be nice to have the option to not follow dynamic imports. Or at the very least, to exclude dynamic imports from a no-circular rule. AFAICT, there’s no (documented) way to disable this though.

Context

We use dependency-cruiser to make sure there aren’t any circular dependencies with static imports. We don’t care so much about the dynamic ones though since they’re less problematic than cycles affecting code that’s run on module execution.

Possible Solution

Perhaps a noFollowDynamic option?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sverweijcommented, Jun 17, 2019

Awesome! I’ve merged the PR and published it as part of dependency-cruiser@4.23.0

1reaction
fongandrewcommented, Jun 16, 2019

I tested it out. Works exactly as expected for our use case. Thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excluding work-in-progress features from your production ...
Excluding work-in-progress features from your production builds using Webpack, feature flags and ES6 dynamic imports.
Read more >
How to prevent typescript from transpiling dynamic imports ...
Option 1: ... If "module" in tsconfig.json is set to "commonjs" , currently there's no way to prevent TypeScript from transpiling dynamic import() ......
Read more >
How to dynamically modify a JS library import to remove next ...
There is normally a simple fix for this, just import the module with SSR disabled, like so: Advanced Features: Dynamic Import | Next.js....
Read more >
Dynamically Importing Components with React.lazy
With React.lazy, you can dynamically import components at run time to ... Feature-flagged components that render different UI based on some ...
Read more >
Output - webpack
The top-level output key contains a set of options instructing webpack on how and where it should output your bundles, assets, and anything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found