$ yarn add vite-plugin-cdn2 -D
# or
$ npm install vite-plugin-cdn2 -D
// vite.config.ts
import { defineConfig } from "vite";
import { cdn } from "vite-plugin-cdn2";
export default defineConfig({
plugins: [
// ... your plugin
cdn({ modules: ["vue"] }),
],
});
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. |
Thanks to JetBrains for allocating free open-source licences for IDEs such as WebStorm.
Kanno