I know you can use shims to run Backbone.js, for example. But let's say you have a library that behaves worse.
For example, a library that simply declares functions in the global namespace.
Can a library like that be used with RequireJS? If so, how?
You sure can. RequireJS has a "shim" option in its configuration for just that:
If it has any dependencies, you can list them here and export the global your legacy file usually produces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With