I am facing a challenge with integrating Typescript UMD modules into legacy code that does not follow any module pattern.
My hope was to find a Webpack loader or plugin that could generate global variables for specific modules instead of treating them as modules.
For instance, I have a Typescript UMD module in a Node package:
node_modules/my-new-module
This module exports a function:
myNewFunction(){ }
My goal is to utilize this function in my legacy code like this:
myNewModule.myNewFunction(); //myNewModule should be accessible globally
Currently, my workaround involves manually loading all shared modules and assigning them to global variables. It's not the most efficient solution.
Is there a way for Webpack to handle this issue? Or perhaps there is another alternative that I haven't considered?
Thank you.