-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not usable via CDN #79
Comments
is there any solution? |
@official-akshayjadhav I used my webpack config to create a dist and added it to my Shopify site's assets as a JS file. Adding an include tag in the main template file saw the JS loaded which means I could use the module. However it would be better to have this module in a CDN. |
you can use skypack, which will transform this nicely for you: https://cdn.skypack.dev/currency-symbol-map example invocation: <script type="module">
import getSymbolFromCurrency from 'https://cdn.skypack.dev/currency-symbol-map'
const s = getSymbolFromCurrency('USD')
</script> |
Perfect, thank you so much! I was able to get it working with this (although I implemented it a bit differently). I had made a file called globalModules.js:
I then imported this into another JS file, which was loaded in the HTML with the type="module" attribute:
Then you directly use the function Get_Currency_Symbol(). |
I have a Shopify site where I need to dynamically convert from a currency code to a symbol. However being in Shopify I can't use NPM modules.
I'm happy to do a PR for a webpack build so that this library can be used via a CDN.
The text was updated successfully, but these errors were encountered: