Could somebody explain how to do dynamic import() of modules using webpack 2?

Answers (2)

Write answer

This answer has received 1 appreciation.


I have written about the topic in detail. TL;DR; use dynamic import or require.ensure. Latter is more flexible, but former is more fun to write as it provides a Promise based interface.

Write a reply...

What specifically are you trying to do? I'm in the middle of a project using webpack 2.

It is quite large lol. It is all a bit weird at times. As for the lodash lib, do you import the whole thing or do you install the specific bits you need? Could be it down quite a lot :)

Write a reply...

loading ...