https://github.com/privatenumber/systemjs-unpkg
SystemJS extra to auto-resolve bare specifiers to UNPKG
https://github.com/privatenumber/systemjs-unpkg
auto bare extra resolve specifier systemjs unpkg
Last synced: 7 months ago
JSON representation
SystemJS extra to auto-resolve bare specifiers to UNPKG
- Host: GitHub
- URL: https://github.com/privatenumber/systemjs-unpkg
- Owner: privatenumber
- License: mit
- Created: 2020-11-14T06:28:17.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-12-03T18:18:12.000Z (almost 5 years ago)
- Last Synced: 2025-02-26T19:17:59.730Z (7 months ago)
- Topics: auto, bare, extra, resolve, specifier, systemjs, unpkg
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# systemjs-unpkg [](https://npm.im/systemjs-unpkg) [](https://npm.im/systemjs-unpkg) [](https://packagephobia.now.sh/result?p=systemjs-unpkg) [](https://bundlephobia.com/result?p=systemjs-unpkg)
Auto-resolve bare specifiers in [SystemJS](https://github.com/systemjs/systemjs) using [UNPKG](https://unpkg.com).
**Before**
Without this plugin, you have to manually declare individual dependencies in an importmap.
```html
{
"imports": {
"lodash/": "//unpkg.com/lodash/",
...
}
}```
```js
// Won't work unless the importmap above is declared
const _ = await System.import('lodash');
```**After✨**
```js
// Automatically resolved without importmap!
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](https://codepen.io/privatenumber/pen/pobGZmR?editors=0010) to get you started!
If you like this project, please star it & [follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️
## 🙋♂️ Why?
- **⚡️ Simplify SystemJS setup** Zero config setup to seamlessly resolve arbitrary bare specifiers with versions!
- **🔥 Import map fallback** Only resolves specifiers that aren't defined in your [import map](https://github.com/systemjs/systemjs/blob/master/docs/import-maps.md)!
- **🐥 Tiny** Only `338B`!## 🚀 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
```