The Requirements:
I am developing a plugin for popularLibrary.js
. The plugin:
- Will not work, at all, if
popularLibrary.js
is not present - Works with
v1.x.x
ofpopularLibrary.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.js
as 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.js
andmyMagicalPlugin.js
, how does thatpeerDependency
resolve? Do I need to do anything extra/special in either library to support this scenario?