The Requirements:
I am developing a plugin for popularLibrary.js. The plugin:
- Will not work, at all, if
popularLibrary.jsis not present - Works with
v1.x.xofpopularLibrary.js - Must work if it's included as a dependency in a project that uses
popularLibrary.js - Must work if it's included as a packaged source alongside
popularLibrary.js
In example:
<script src="https://some-cdn.com/popularLibrary.js"></script>
<script src="https://some-cdn.com/myMagicalPlugin.js"></script>
The Problems:
- When I set
popularLibrary.jsas apeerDependency, it is no longer downloaded onnpm install. How do I continue to develop my plugin when it needs to import and utilize functionality that exists inpopularLibrary.js? - Not everyone uses a build step. If someone adds the minified sources for
popularLibrary.jsandmyMagicalPlugin.js, how does thatpeerDependencyresolve? Do I need to do anything extra/special in either library to support this scenario?