Doesn't handle dynamic imports
See original GitHub issueWeb apps often lazy load modules to defer requests. ts-prune doesn’t detect these imports.
E.g.,
const module = await import(/* webpackChunkName: 'user_prompts_lazy' */ 'user_prompts');
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Don't dynamically import code in a directory - ITNEXT
Some IDEs, like VSCode, use statically defined import statements to navigate a codebase. However, with dynamic importing through the file system ...
Read more >Dynamic imports solve all the problems, right? - Minko Gechev
This is one of the reasons why in the general case Guess.js, cannot handle dynamic imports and map them directly to Google Analytics...
Read more >Dynamic Imports: Am I missing something? - Stack Overflow
1. First, good way of thinking. · Hi @RazRonen -- thanks for the insight. I'm using splitChunks in my Webpack config to split...
Read more >Dynamic imports - The Modern JavaScript Tutorial
Dynamic imports work in regular scripts, they don't require script type="module" . Please note: Although import() looks like a function call, ...
Read more >Webpack and Dynamic Imports: Doing it Right - Medium
Dynamic imports : the basics ... The above code will load the foo module at runtime, and resolving it, will log the default...
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 Free
Top 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

@koddsson You’re welcome to try and make the gist perform well and perform correctly. Maybe the APIs had changed to the point that the gist is fast again. For context, please see #2.
If you are looking for user input then I’d take poor performance over not being able to use the app at all since I’m using dynamic imports.
The gist runs for ~16s going over ~73500 files on my local machine. I’m planning to only run it in CI so I don’t mind the time it takes. I realize that might be the use case for everyone though.