vite-add-cdn-script 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("cdn-script-core")):typeof define=="function"&&define.amd?define(["cdn-script-core"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.index=r(e.
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("cdn-script-core")):typeof define=="function"&&define.amd?define(["cdn-script-core"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.index=r(e.cdnScriptCore))})(this,function(e){"use strict";var r=(n=>(n.PRE="pre",n.POST="post",n))(r||{});const d="vite-add-cdn-script";function f(n){const{customScript:a={},defaultCdns:i=["jsdelivr","unpkg"]}=n;let o;return{name:d,enforce:r.PRE,apply:"build",config(t){o=t},async transformIndexHtml(t){var p,u;if(!i||i.length===0)throw new Error("defaultCdns不能为空");const s=(u=(p=o.build)==null?void 0:p.rollupOptions)==null?void 0:u.external;if(!s)return t;try{const c=await e.getExternalScript({libName:d,customScript:a,external:s,defaultCdns:i});return t=t.replace("</head>",`${c}</head>`),t}catch(c){console.error("vite-add-cdn-script error:",c.message),process.exit(1)}}}}return f});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite-add-cdn-script",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"keywords": [
|
5
5
|
"vite",
|
6
6
|
"cdn",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"exports": {
|
27
27
|
"types": "./index.d.ts",
|
28
28
|
"import": "./dist/index.js",
|
29
|
-
"require": "./dist/index.
|
29
|
+
"require": "./dist/index.umd.cjs"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
32
|
"@jest/globals": "^29.7.0",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"registry": "https://registry.npmjs.org/"
|
53
53
|
},
|
54
54
|
"dependencies": {
|
55
|
-
"cdn-script-core": "1.0.
|
55
|
+
"cdn-script-core": "1.0.2"
|
56
56
|
},
|
57
57
|
"scripts": {
|
58
58
|
"dev": "vite",
|