Closed ruud closed 6 years ago
Polymer's lazy imports are not supported by the loader. Loaders are restricted to transforming a single file at a time and the HTML and JS for a component can be in separate files.
Instead, use this style syntax to support lazy loading:
Promise.all([
import('./path/to/component1.html'),
import('./path/to/component2.html')
]).then(() => {
// components are loaded - use them
});
Webpack automatically recognizes this style of import as a split point and will move component1 and 2 into a separate bundle which is loaded on demand.
Thanks for your reply!
related issue: https://github.com/Polymer/lazy-imports/issues/46
We are using the https://github.com/Polymer/lazy-imports in our application. We also would like to use webpack for our build. How would you suggest using these two together?