0.1.2 • Published 6 years ago

rollup-plugin-cdn v0.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

rollup-plugin-cdn

donate Coverage Status Build Status License: ISC

Resolve locally all dependencies loaded through fully qualified CDN urls.

Supported CDNs

Following the list of supported CDNs (so far).

Example

If your module has hyperHTML as dependency, and you have installed it locally, you can import it as fully qualified ESM module.

The remote url will be resolved through the locally installed dependency.

import hyper from 'https://unpkg.com/hyperhtml@latest/esm/index.js';

hyper(document.body)`
  <h1>Hello ESM</h1>`;

This enables your modules to be natively testable/usable as ESM in browsers, but also easily bundled for production.

Installation

$ npm install rollup-plugin-cdn

Usage

// rollup.config.js
import cdn from 'rollup-plugin-cdn';

export default {
  input: './esm/index.js',
  plugins: [cdn()],
};

License

ISC, see LICENSE for more information.