vite-plugin-cdn2
v1.1.0
Published
A Vite plugin that allowed you replace module with CDN
Maintainers
Readme
Install
$ yarn add vite-plugin-cdn2 -D
# or
$ npm install vite-plugin-cdn2 -D
Usage
// 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<IModule \| string> | [] | 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 for allocating free open-source licences for IDEs such as WebStorm.
Document
LICENSE
Author
Kanno
