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.

Doesn't handle dynamic imports

See original GitHub issue

Web 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:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nadeeshacommented, Jun 6, 2020

@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.

1reaction
koddssoncommented, Jun 5, 2020

Unfortunately, the version in the gist uses APIs that yield poor performance.

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.

Read more comments on GitHub >

github_iconTop 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 >

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