• Code for injecting into subapp declaring JS module to enable hot module reloading

    The code will use webpack's module.hot.accept API to add acceptance hook for a import JS module.

    The webpack plugin in plugins/subapp-plugin.ts will inject this code when it detect a JS module declares subapps.

    Parameters

    • w: any

      the window object

    • hot: any

      webpack's module.hot API

    • Optional reload: ReloadFunction

      the function to call to reload a module

    Returns any

    Remarks

    the plugin will use the code from toString of this function to inject the code, so this function cannot have any external dependencies.