Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinicius73/rollup-plugin-pika-resolver
Generate the bundle of your project using Pika CDN for external dependencies.
https://github.com/vinicius73/rollup-plugin-pika-resolver
pika pika-cdn rollup rollup-plugin
Last synced: about 2 months ago
JSON representation
Generate the bundle of your project using Pika CDN for external dependencies.
- Host: GitHub
- URL: https://github.com/vinicius73/rollup-plugin-pika-resolver
- Owner: vinicius73
- License: mit
- Created: 2020-05-27T20:55:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:43:41.000Z (almost 2 years ago)
- Last Synced: 2024-05-14T11:44:06.043Z (7 months ago)
- Topics: pika, pika-cdn, rollup, rollup-plugin
- Language: JavaScript
- Homepage:
- Size: 285 KB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - skypack-resolver - Use [Skypack CDN](https://skypack.dev/) for external dependencies. (Plugins / Modules)
README
# @vinicius73/rollup-plugin-skypack-resolver
Generate the bundle of your project using [Skypack CDN](https://www.skypack.dev) for external dependencies.
[![Maintainability](https://api.codeclimate.com/v1/badges/5fa12e0c2482b3da931f/maintainability)](https://codeclimate.com/github/vinicius73/rollup-plugin-pika-resolver/maintainability)
[![Build Status](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/badges/build.png?b=master)](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/build-status/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/vinicius73/rollup-plugin-pika-resolver/?branch=master)
[![@vinicius73/rollup-plugin-skypack-resolver](https://img.shields.io/npm/v/@vinicius73/rollup-plugin-skypack-resolver)](https://www.npmjs.com/package/@vinicius73/rollup-plugin-skypack-resolver)## Install
```sh
yarn add @vinicius73/rollup-plugin-skypack-resolver rollup -D
```## Usage
On this example, [axios](https://www.skypack.dev/npm/axios) and [lodash-es](https://www.skypack.dev/npm/lodash-es) need be installed as project dependencies, using [npm](https://www.npmjs.com/get-npm) or [yarn](https://classic.yarnpkg.com/en/docs/install).
> `skypackResolver` uses your local dependencies to determine cdn version.
```js
//> rollup.config.js
const { skypackResolver } = require('@vinicius73/rollup-plugin-skypack-resolver')module.exports = {
input: 'src/index.js',
output: {
format: 'es'
},
plugins: [skypackResolver({
modules: ['axios', 'lodash-es']
})]
}
``````js
//> src/index.js
import axios from 'axios'
import { get } from 'lodash-es'const run = async () => {
const { data } = await axios.get('https://reqres.in/api/users/2')
console.log(
get(data, ['data', 'email'])
)
}run()
.then(() => console.log('All done'))
.catch(err => console.error(err))
``````sh
rullup -c
``````js
//> output
import axios from 'https://cdn.skypack.dev/[email protected]';
import { get } from 'https://cdn.skypack.dev/[email protected]';const run = async () => {
const { data } = await axios.get('https://reqres.in/api/users/2');
console.log(get(data, ['data', 'email']));
};run()
.then(() => console.log('All done'))
.catch(err => console.error(err));
```## Options
### `modules`
Type: `Array[...String]`
Required: `true`An array with modules that will be transformed into cdn import.
### `cdnHost`
Type: `String`
Required: `false`
Default: `https://cdn.skypack.dev`Host used in imports.