We can do this in React, but it doesn't currently work when you try to use npm dependencies in vanilla javascript files. My current workaround is to source the dependencies from a cdn via the script tag within the html. But this breaks eslint — the linter treats that dependency as undefined if you use it in a javascript file. Here's an example where eslint fails because of this: https://github.com/datamade/il-nwss-dashboard/runs/7433410692?check_suite_focus=true. You can work that by adding /*global Plot */ to the top of the failing file, which I'd rather not do because that can get messy and out of hand.
We can do this in React, but it doesn't currently work when you try to use npm dependencies in vanilla javascript files. My current workaround is to source the dependencies from a cdn via the script tag within the html. But this breaks eslint — the linter treats that dependency as undefined if you use it in a javascript file. Here's an example where eslint fails because of this: https://github.com/datamade/il-nwss-dashboard/runs/7433410692?check_suite_focus=true. You can work that by adding
/*global Plot */
to the top of the failing file, which I'd rather not do because that can get messy and out of hand.