useless import in multientry mode
isergey87 opened this issue · 2 comments
isergey87 commented
Rollup Version
4.13.0
Operating System (or Browser)
Chrome
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
main.js without global imports
import { commonB } from './b.js';
function a() {
console.log('function a');
commonB();
}
export { a };
I tried different treeshake configurations, but the imports remained
Actual Behaviour
import to other entry or external lib;
import { commonB } from './b.js';
import './c.js';
import 'react-tooltip';
function a() {
console.log('function a');
commonB();
}
export { a };
lukastaegert commented
See https://rollupjs.org/faqs/#why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting for an explanation,
output.hoistTransitiveImports
is the option you are looking for.
isergey87 commented
Thank you