Almost every modern web application is using some kind of dependency, even besides the preferred JavaScript framework.

While most of the dependencies are available through NPM, many of them also provide a link to a CDN (Content Delivery Network) version so it can be included in any project without additional efforts or build steps.

But there is also a fair amount of popular third-party libraries that don’t provide an NPM package and rely fully on being implemented via the script tag. Common examples are newsletter integrations, contact forms, and the Stripe SDK to process payments.

Having only a CDN link brings some benefits like allowing seamless updates from the authors without having the developers to update their software but it also has it’s drawbacks, especially when working with modern JavaScript frameworks.

The integration, especially when only needed on a single page, becomes more complex. In addition, developers have to deal with asynchronously loading scripts.

Let’s see how we can add such third party dependencies in our Nuxt.js project!

#tutorials #nuxt #nuxt.js

How to load third-party scripts in Nuxt.js
38.25 GEEK