An open API service indexing awesome lists of open source software.

https://github.com/dashpilot/pica-cdn


https://github.com/dashpilot/pica-cdn

Last synced: 26 days ago
JSON representation

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`