Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-cdn-import

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-cdn-import - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

24

dist/index.d.ts

@@ -110,2 +110,26 @@ import { Plugin } from 'vite';

};
axios: {
var: string;
jsdeliver: {
path: string;
};
};
lodash: {
var: string;
jsdeliver: {
path: string;
};
};
'crypto-js': {
var: string;
jsdeliver: {
path: string;
};
};
localforage: {
var: string;
jsdeliver: {
path: string;
};
};
};

@@ -112,0 +136,0 @@ declare type ModuleName = keyof typeof modulesConfig;

36

dist/index.js

@@ -119,2 +119,26 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty;

}
},
"axios": {
var: "axios",
jsdeliver: {
path: "dist/axios.min.js"
}
},
"lodash": {
var: "_",
jsdeliver: {
path: "lodash.min.js"
}
},
"crypto-js": {
var: "crypto-js",
jsdeliver: {
path: "crypto-js.min.js"
}
},
"localforage": {
var: "localforage",
jsdeliver: {
path: "dist/localforage.min.js"
}
}

@@ -128,2 +152,5 @@ };

}
function isCdnjs(prodUrl) {
return prodUrl.includes("//cdnjs.cloudflare.com");
}
function autoComplete(name) {

@@ -135,3 +162,8 @@ const config = modulesConfig[name];

return (prodUrl) => {
if (isJsdeliver(prodUrl) || isUnpkg(prodUrl)) {
if (isCdnjs(prodUrl)) {
throw new Error(`The configuration of module ${name} in ${prodUrl} does not exist `);
} else {
if (!(isJsdeliver(prodUrl) || isUnpkg(prodUrl))) {
console.warn("Unknown prodUrl, using the jsdeliver rule");
}
return __spreadValues({

@@ -141,4 +173,2 @@ name,

}, config.jsdeliver);
} else {
throw new Error(`The configuration of module ${name} in ${prodUrl} does not exist `);
}

@@ -145,0 +175,0 @@ };

2

package.json
{
"name": "vite-plugin-cdn-import",
"version": "0.3.1",
"version": "0.3.2",
"description": "Import packages from CDN for the vite plugin",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -78,3 +78,9 @@ # Import modules from CDN with vite plugin

```
"react" | "react-dom" | "react-router-dom" | "antd" | "ahooks" | "@ant-design/charts" | "vue" | "vue2" | "@vueuse/shared" | "@vueuse/core" | "moment" | "eventemitter3" | "file-saver" | "browser-md5-file" | "xlsx"
"react" | "react-dom" | "react-router-dom" |
"antd" | "ahooks" | "@ant-design/charts" |
"vue" | "vue2" | "@vueuse/shared" |
"@vueuse/core" | "moment" |
"eventemitter3" | "file-saver" |
"browser-md5-file" | "xlsx | "crypto-js" |
"axios" | "lodash" | "localforage"
```

@@ -81,0 +87,0 @@

@@ -76,3 +76,9 @@ # 从 CDN 加载 modules 的 vite 插件

```
"react" | "react-dom" | "react-router-dom" | "antd" | "ahooks" | "@ant-design/charts" | "vue" | "vue2" | "@vueuse/shared" | "@vueuse/core" | "moment" | "eventemitter3" | "file-saver" | "browser-md5-file" | "xlsx"
"react" | "react-dom" | "react-router-dom" |
"antd" | "ahooks" | "@ant-design/charts" |
"vue" | "vue2" | "@vueuse/shared" |
"@vueuse/core" | "moment" |
"eventemitter3" | "file-saver" |
"browser-md5-file" | "xlsx | "crypto-js" |
"axios" | "lodash" | "localforage"
```

@@ -79,0 +85,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc