Hello there,
I am currently dealing with a legacy application that relies on various libraries such as jQuery, moment.js, and underscore. These libraries were manually assembled and added to the repository in a loosely coupled manner. My goal is to transition this setup to a more modern package manager like npm or yarn to simplify the management of dependencies when updates are needed.
Although I have attempted to use webpack for this purpose, I have encountered difficulties in bundling these libraries in a way that allows them to be globally accessible (even though I understand that this goes against best practices, I am constrained by the inability to rewrite the existing legacy code).
Is it feasible to achieve my desired outcome?
For example, could I create a dependencies.js file containing require(xx) statements, and then load it as a script in the browser to make the libraries globally available instead of individually loading each one from a local source?