Auto-resolve bare specifiers in SystemJS using UNPKG
npm install systemjs-unpkgAuto-resolve bare specifiers in SystemJS using UNPKG.
Before
``html`
`js`
// Won't work unless the import map above is declared
const _ = await System.import('lodash');
AfterāØ
`js`
// Automatically resolved without import map!
const _ = await System.import('lodash');
You can also specify npm semver ranges and tags
`js
const $ = await System.import('jquery@2.2.4');
const $ = await System.import('jquery@^2.2.4');
const d3 = await System.import('d3@next');
`
Here's a starter CodePen template to get you started!
If you like this project, please star it & follow me to see what other cool projects I'm working on! ā¤ļø
!š Install
`sh
npm i systemjs-unpkg
`š¦ Quick Setup
Simply load systemjs-unpkg after you load SystemJS.If you're using a JS bundler:
`js
// Load systemjs
import 'systemjs';// Load the systemjs AMD extra, as most npm packages have UMD/AMD distributions
import 'systemjs/dist/extras/amd';
// Load systemjs-unpkg
import 'systemjs-unpkg';
`If in a browser:
`html
``