I'm facing problems importing npm package 'convert-units' with unpkg, I tried this :
<script src="unpkg.com/[email protected]/lib/index.js"></script>
But it seems not to work
I'm facing problems importing npm package 'convert-units' with unpkg, I tried this :
<script src="unpkg.com/[email protected]/lib/index.js"></script>
But it seems not to work
I came with an idea, I can't see the whole code, but... Are you requesting this package
BEFORE
any otherJavaScript
that uses this function?I mean, something like this:
Otherwise, if you first use package functions and then import it, those functions would be
not defined
.So, remember, order matters in this scenario.
If you did this, you need to import the module in every place that you use it: