Skip to content

Dynamically require module #3079

Closed

Description

@NilsQuirmbach

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.

Activity

  1. filipesilva commented on Nov 21, 2016

    @filipesilva
    Contributor

    @TheLarkInn can you give some assistance as to how to dynamically require modules in webpack2? I believe it's just doing System.import but some typings might be needed as well.

  2. NilsQuirmbach commented on Nov 22, 2016

    @NilsQuirmbach
    Author

    I tried it with System.import, but it fails the same as it does with require.

    image

  3. NilsQuirmbach commented on Nov 28, 2016

    @NilsQuirmbach
    Author

    I made a small example to make it more clear, what I am trying to archive.

    https://github.com/NilsQuirmbach/dynamic-require

  4. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions