Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/nonzzz/vite-plugin-cdn

replace module with CDN. work with vite.
https://github.com/nonzzz/vite-plugin-cdn

vite-plugin vite-plugin-cdn

Last synced: about 2 months ago
JSON representation

replace module with CDN. work with vite.

Awesome Lists containing this project

README

        


vite-plugin-cdn


Coverage Status

## Install

```bash

$ yarn add vite-plugin-cdn2 -D

# or

$ npm install vite-plugin-cdn2 -D

```

## Usage

```typescript
// vite.config.ts

import { defineConfig } from "vite";

import { cdn } from "vite-plugin-cdn2";

export default defineConfig({
plugins: [
// ... your plugin
cdn({ modules: ["vue"] }),
],
});
```

## Options

| params | type | default | description |
| ---------- | --------------------------- | ------------------------------------------- | ---------------------------------------------------- |
| `include` | `FilterPattern` | `/\.(mjs\|js\|ts\|vue\|jsx\|tsx)(\?.*\|)$/` | Include all assets matching any of these conditions. |
| `exlcude` | `FilterPattern` ß | `-` | Exclude all assets matching any of these conditions. |
| `modules` | `Array ` | `[]` | Should convert module. |
| `logLevel` | `slient\|warn` | `warn` | Adjust console output verbosity. |
| `resolve` | `ResolveOptions` | `jsdelivr plugin` | URL parser injected into the page. |
| `apply` | `string` | `build` | Same as vite apply. |

### Acknowledgements

Thanks to [JetBrains](https://www.jetbrains.com/) for allocating free open-source licences for IDEs such as WebStorm.


JetBrains Black Box Logo logo.

### Document

- [Background](./docs/Background.md)
- [How it works](./docs/How-it-works.md)
- [Q & A](./docs/Q&A.md)

### LICENSE

[MIT](./LICENSE)

### Author

Kanno