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.

Remove unused imports

See original GitHub issue
// Map won't be eliminated when bundling
import Map from 'lodash.map'

There are non-pure modules with side effects. Is there any way to remove the unused import regardless of side-effect. Possible related rollup feature Thank you.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hiendvcommented, Jun 20, 2017

@j-f1 Thank you. So I guess the burden of pruning unused pure external imports should be on the bundler end, not babili.

1reaction
j-f1commented, Jun 18, 2017

@boopathi You could remove the unused named exports (and then an empty {}), then remove the unused default export:

import foo, { bar, baz } from './quux'
import foo, {} from './quux'
import foo from './quux'
import './quux'

This way, you could shorten the imports without side effects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove unused imports in VSCode. - LinkedIn
Follow these steps to setup settings in VS Code. Press [Command + , ] to open settings. Click on that top-right icon (Open...
Read more >
How to remove unused imports from Eclipse - Stack Overflow
Go to Window → Preferences → Java → Editor → Save Actions. · Check the option "Perform the selected actions on save". ·...
Read more >
How to Remove all Unused Imports in a Java File — Eclipse ...
1) Go to the line of unused import, press Ctrl + 1, which is an Eclipse shortcut of a quick fix. This will...
Read more >
Remove all unused imports in one go using Eclipse IDE
But we do have a shortcut for this, just in a millisecond our Eclipse IDE done this job for us. Eclipse provide a...
Read more >
PyCQA/autoflake: Removes unused imports and ... - GitHub
To remove all unused imports (whether or not they are from the standard library), use the --remove-all-unused-imports option. To remove unused variables, use ......
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