Feature request: Option to exclude dynamic imports
See original GitHub issueNow 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:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Awesome! I’ve merged the PR and published it as part of dependency-cruiser@4.23.0
I tested it out. Works exactly as expected for our use case. Thank you very much!