rollup-plugin-skypack
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

rollup-plugin-skypack

Skypack https://www.skypack.dev/ Everything on npm, delivered directly to your browser.

Can boost load for commonly used module with cdn (like react, lodash)

WARNING THIS PLUGIN IS UNOFFICIAL

Features

  • Auto resolving PINNED urls

Install

yarn add rollup-plugin-skypack

Usage

it is recommended to install the local dependencies with npm and yarn (but optional, default use latest version)

//> rollup.config.js
 
import skypack from 'rollup-plugin-skypack';
 
module.exports = {
  input: 'src/index.js',
  output: {
    format: 'es',
  },
  plugins: [
    skypack({
      modules: ['axios', 'react', 'react-dom'],
      optimize: true, // USE PINNED URL, false for lookup url
    }),
  ],
};

Options

interface SkypackPluginOptions {
  /**
   * desired module would load with skypack cdn, and remove at the bundle
   */
  modules: string[];
  /**
   * @see https://docs.skypack.dev/lookup-urls/pinned-urls-optimized
   *
   * if true use pinned url (load fast but build is slow, for production)
   *
   * if false use lookup url (build fast)
   *
   * @example optimize: process.env.NODE_ENV === 'production'
   */
  optimize: boolean;
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.00

Package Sidebar

Install

npm i rollup-plugin-skypack

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

9.92 kB

Total Files

12

Last publish

Collaborators

  • yj01jung