I am developing a JavaScript calculator plugin that does all the mathematical operations using bignumber as I see I can manage the dependency in two ways:
- Include with the code base the bignumber code.
- Localize the dependency once the plugin is loaded and throw an error if the dependency can not be resolve. I think i can resolve in four ways: accepting it in a function, try to resolve using amd, try to resolve using commonjs, try to get it from the global object.
Has anyone try the second approach, if yes how did you did it?
Does anyone know any pattern to resolve this?
<script src=...>
block the files will be downloaded automatically, so there's no dependency problem.