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


Write your response…

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...

Join a friendly and inclusive Q&A network for coders

  • 🖥Pick the technologies you like & read great content through your feed.
  • 💬Ask a question when you want to learn more about anything.
  • 🚀Share what you know & build your portfolio.
Sign up nowLearn more

loading ...