https://github.com/dashpilot/pica-cdn
https://github.com/dashpilot/pica-cdn
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dashpilot/pica-cdn
- Owner: dashpilot
- Created: 2026-01-28T17:59:32.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-28T18:06:59.000Z (6 months ago)
- Last Synced: 2026-01-29T08:46:14.657Z (6 months ago)
- Language: HTML
- Homepage: https://pica-cdn.vercel.app
- Size: 106 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pica CDN build
This repo bundles [`nodeca/pica`](https://github.com/nodeca/pica) into browser-ready files you can host on any static CDN.
## Build
```bash
npm install
npm run build
```
Outputs:
- `dist/pica.esm.js` (ES module)
- `dist/pica.iife.js` (classic `` build, exposes `globalThis.pica`)
- `dist/pica.iife.min.js` (minified classic build)
## Use via CDN
### Classic `<script>` (global)
```html
<script src="https://pica-cdn.vercel.app/pica.iife.min.js">
const p = window.pica();
// await p.resize(from, to)
```
### ESM
```html
import pica from "https://pica-cdn.vercel.app/pica.esm.js";
const p = pica();
```
## Local demo
After building, open `index.html` (served from a static server).
Example:
```bash
npx serve .
```
## Vercel
This repo includes `vercel.json` and the build writes `dist/index.html`, so Vercel can deploy it as a static site.
- **Build Command**: `npm run build`
- **Output Directory**: `dist`