'Isolate used libraries in webpack project

I have written a WebGL JavaScript app to display small models. I am using WebPack 5.66 and some of my users report issues with libraries that I am using. For example I am using lodash and polyfill. Now my users are saying that some important lodash functions are missing. Or that my polyfill is conflicting with their usage of their own polyfills.

How can I create a Webpack app that uses libraries without these libraries affecting other parts of a website other than my own WebGL app ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source