With services like unpkg, we could load stuff from npm pretty easily. Maybe this should just be an option passed in?
Idea:
addtopage('moment', { npm: true }) // loads latest version of moment through http://unpkg.com/moment
If that's true, we'll also need some way of specifying which file to load for libraries where the "main" file isn't what we need when using addtopage.
Idea:
// just add it all here; most likely the easiest route since it's just appending the stuff to the unpkg URL
addtopage('react@15.3.1/dist/react.min.js', { npm: true })
// could use multiple options; probably only useful if a CDN other than unpkg is going to be used
addtopage('react', {
npm: true,
version: '15.3.1',
file: '/dist/react.min.js'
})
With services like unpkg, we could load stuff from npm pretty easily. Maybe this should just be an option passed in?
Idea:
If that's true, we'll also need some way of specifying which file to load for libraries where the "main" file isn't what we need when using
addtopage
.Idea: