Registry / http-networking / rollup-plugin-skypin

rollup-plugin-skypin

JSON →
library1.1.2jsnpmunverified

A Rollup plugin that converts bare Node-style imports into pinned URLs from skypack.dev CDN, enabling browser-friendly ESM imports from npm packages. Version 1.1.2 is stable and actively maintained. It supports options for minified vs. normal builds, pinned URLs for production, custom replacement logic, and handling of relative/web imports. Key differentiator: lightweight, focused alternative to other CDN plugin approaches; based on skypin library.

npm install rollup-plugin-skypin
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SKYP
R
rollup-plugin-skypin
http-networkingjavascriptv1.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

skypin (default)
import { skypin } from 'rollup-plugin-skypin'
import skypin from 'rollup-plugin-skypin'
Named export, not default. Also available as require('rollup-plugin-skypin').skypin in CommonJS.
type Options (if needed)
import type { Options } from 'rollup-plugin-skypin'
import { Options } from 'rollup-plugin-skypin'
Value import will error at runtime; use type import for TypeScript.
Rollup plugin usage
skypin({ minified: false })
new skypin({ minified: false })
skypin is a function, not a class. Do not use 'new'.

Showcases a Rollup configuration using the skypin plugin with options: minified, pinned URL, and custom replacement logic.

// rollup.config.js import { skypin } from 'rollup-plugin-skypin'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'esm' }, plugins: [ skypin({ minified: true, pinned: true, shouldReplace: (id) => id.startsWith('some-prefix') ? id : false }) ] };
Debug
Known issues
breakingPlugin expects Rollup v1+; may not work with older Rollup versions.
fix
Ensure Rollup >= 1.0.0 is installed.
affects: <1.0.0
gotchashouldReplace returning a string replaces the module id but does NOT handle the resolution; it overrides the original id.
fix
Return false to keep original behavior, or a CDN-ready URL string to replace entirely.
affects: >=0.1.0
gotcharelative_external option: when true, relative imports (./foo) are marked external; if false, they are processed by skypin (likely error).
fix
Set relative_external: true if you have local files; false only if all imports are npm packages.
affects: >=0.1.0
deprecatedOption 'minified' default true may change in future versions.
fix
Explicitly set minified: true to preserve current behavior.
affects: >=1.0.0
gotchaPlugin does not handle Node.js built-in modules; they must be externalized separately.
fix
Add builtins to rollup external config or use @rollup/plugin-node-resolve with preferBuiltins: false.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'skypin'
Missing dependency skypin; it is a peer dependency but not automatically installed.
fix
npm install skypin --save-dev
TypeError: (intermediate value) is not a function
Using default import instead of named import: import skypin from 'rollup-plugin-skypin' returns undefined.
fix
Use named import: import { skypin } from 'rollup-plugin-skypin'
Error: Could not resolve import for 'some-package'
shouldReplace returned true for a package that is not on skypack (e.g., relative path or Node built-in).
fix
In shouldReplace, check if id is an npm package name and return false for local/built-in modules.
Module 'rollup-plugin-skypin' resolved to a CommonJS file
Old Rollup configuration (format 'cjs') may not handle ESM plugin correctly.
fix
Ensure Rollup config uses format 'esm' or use rollup-plugin-skypin in a .mjs config file.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
skypinrequiredruntime dependency for converting package names to skypack URLs
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
rollup-plugin-skypin — npm install rollup-plugin-skypin · libregistry