P
P
pqgg7nwkd42017-05-14 00:40:21
JavaScript
pqgg7nwkd4, 2017-05-14 00:40:21

How to dynamically load an unknown module?

Good afternoon. Learning webpack, babel and new js features. Got a question.
There are many modules.
Each has an export default class.
You need to create an instance of each of them.
Moreover, these modules can lie in any folders. But at the same time, dynamic loading from the server will not be applied.
How can I do that?
What is needed? There is a form designer that saves it in json. I need to recreate the form using this json.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2017-05-14
@k12th

For dynamic imports use import() . webpack 2 does it out of the box.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question