Dynamically require module #3079
Copy link
Copy link
Closed
Description
I need to dynamically require a module.
In webpack I did it via require.ensure, but this is not working.
Case:
I am getting data from the server and have to map these to a ts classes and create an object tree.
The data can be nested infinitely, so I have to load the module dynamic depending on a type attached to the data.
Reactions are currently unavailable
Activity
filipesilva commentedon Nov 21, 2016
@TheLarkInn can you give some assistance as to how to dynamically require modules in webpack2? I believe it's just doing
System.importbut some typings might be needed as well.NilsQuirmbach commentedon Nov 22, 2016
I tried it with
System.import, but it fails the same as it does withrequire.NilsQuirmbach commentedon Nov 28, 2016
I made a small example to make it more clear, what I am trying to archive.
https://github.com/NilsQuirmbach/dynamic-require
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.