How to add an external javascript CDN in sage 9

Does anyone know how would the process of adding an external CDN script in sage 9 be?? I have an external CDN script that I need to include in my project using sage 9. Here is its source "https://service.force.com/embeddedservice/4.1/esw.min.js"
Thanks for your help!

I’m not sure how this question is Sage-specific. You add scripts with wp_enqueue_script() just like you would with any other theme.

If you need access to it in your local scripts, you can add it to externals in your webpack config so that webpack won’t attempt to import it.

1 Like

Thanks for your response to this topic. It seems like some additional steps were taken in the mapping process of the external cdn script in reference to this topic What's the best way to add external (CDN) scripts?
for instance, the script is being added in lib/assets.php, and using bower. sage 9 has different file structure and uses a different package manager.

Package managers by definition do not manage external scripts.

The file where you enqueue your scripts is largely up to you: You just need to make sure it’s being loaded at the correct time in WordPress’s process. All of that is explained in the Codex entry for wp_enqueue_script().