Webpack seems to be including some extra code instead of chunking, maybe I am not understanding import
correctly?
import {detector as d1} from './summernote';
class Detector {
loadModules() {
// assume d1() returns false
d1() ? System.import('./summernote').then(this.instantiateModule) : undefined;
}
instantiateModule(importedModule) {
new importedModule.default();
}
}
export default Detector;
It seems to be bundling Summernote (the default export from './summernote') when I don't want it to.
If I remove the initial import and put true
in place of d1()
it correctly chunks Summernote.
Is there any way to make it so that it includes the member {detector} in the bundle, but puts the Summernote default export in a separate chunk?