Skip to content

Instantly share code, notes, and snippets.

@mig82
Created August 27, 2021 08:11
Show Gist options
  • Save mig82/c7a022a074b6a1a14d948efb29c7a040 to your computer and use it in GitHub Desktop.
Save mig82/c7a022a074b6a1a14d948efb29c7a040 to your computer and use it in GitHub Desktop.
RequireJS module from a remote or CDN location
// We do this to avoid cluttering the project with 3rd party JS.
// It also avoids loading all the 3rd party JS at app launch.
require.config({
paths: {
"lodash": "https://cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min",
"moment": "https://momentjs.com/downloads/moment-with-locales.min"
},
waitSeconds: 10
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment