0.0.0 • Published 2 years ago

vite-plugin-cdn-tmp v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@vitejs/plugin-cdn npm

Note: this plugin requires vite@^2.0.0-beta.26.

A plugin that loads specified dependencies over Native-ESM CDNs during dev, and downloads / includes them in the production bundle during build.

Usage

// vite.config.js
import cdn from "@vitejs/plugin-cdn";

export default {
  plugins: [
    // provider can be one of: 'skypack' | 'esm.run' | 'jspm'
    cdn("skypack", {
      // list dependencies like in package.json
      // note that jspm does not support semver ranges
      vue: "^3.0.5",
    }),
  ],
};

Supported Native ESM CDNs


*Note: jspm does not support semver ranges and can only use exact version of dist tags. It also detects the usage of process.env and turns Vue esm files into CJS which breaks its usage as native ESM.