vite-add-cdn-script 0.0.2 → 0.0.4
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/index.d.ts +7 -7
- package/package.json +48 -48
package/dist/index.js
CHANGED
@@ -13,7 +13,7 @@ const d = {
|
|
13
13
|
}, p = {
|
14
14
|
react: "umd/react.production.min.js",
|
15
15
|
"react-dom": "umd/react-dom.production.min.js",
|
16
|
-
"react-router-dom": "react-router-dom.production.min.js",
|
16
|
+
"react-router-dom": "dist/react-router-dom.production.min.js",
|
17
17
|
mobx: "dist/mobx.umd.production.min.js",
|
18
18
|
"mobx-react": "/dist/mobxreact.umd.production.min.js",
|
19
19
|
vue: "/dist/vue.global.prod.js",
|
package/dist/index.umd.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(t,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("node:path"),require("node:fs")):typeof define=="function"&&define.amd?define(["node:path","node:fs"],r):(t=typeof globalThis<"u"?globalThis:t||self,t.index=r(t.path,t.fs))})(this,function(t,r){"use strict";const o={unpkg:"unpkg.com",staticfile:"cdn.staticfile.net",cdnjs:"cdnjs.cloudflare.com/ajax/libs",jsdelivr:"cdn.jsdelivr.net/npm"},a={unpkg:"@",staticfile:"/",cdnjs:"/",jsdelivr:"@"},i={react:"umd/react.production.min.js","react-dom":"umd/react-dom.production.min.js","react-router-dom":"react-router-dom.production.min.js",mobx:"dist/mobx.umd.production.min.js","mobx-react":"/dist/mobxreact.umd.production.min.js",vue:"/dist/vue.global.prod.js","vue-router":"/dist/vue-router.global.prod.js"};function f(j){const{protocol:b="https",customScript:d={},retryTimes:g=3,defaultCdns:u=["unpkg","cdnjs","jsdelivr","staticfile"]}=j;let p;return{name:"vite-add-cdn-script",enforce:"pre",apply:"build",config(n){p=n},transformIndexHtml(n){const O=t.resolve(process.cwd(),"package.json");try{const s=u[0],N=r.readFileSync(O,"utf-8"),l=JSON.parse(N),h=p.build.rollupOptions.external;let c=""+`<script>
|
1
|
+
(function(t,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("node:path"),require("node:fs")):typeof define=="function"&&define.amd?define(["node:path","node:fs"],r):(t=typeof globalThis<"u"?globalThis:t||self,t.index=r(t.path,t.fs))})(this,function(t,r){"use strict";const o={unpkg:"unpkg.com",staticfile:"cdn.staticfile.net",cdnjs:"cdnjs.cloudflare.com/ajax/libs",jsdelivr:"cdn.jsdelivr.net/npm"},a={unpkg:"@",staticfile:"/",cdnjs:"/",jsdelivr:"@"},i={react:"umd/react.production.min.js","react-dom":"umd/react-dom.production.min.js","react-router-dom":"dist/react-router-dom.production.min.js",mobx:"dist/mobx.umd.production.min.js","mobx-react":"/dist/mobxreact.umd.production.min.js",vue:"/dist/vue.global.prod.js","vue-router":"/dist/vue-router.global.prod.js"};function f(j){const{protocol:b="https",customScript:d={},retryTimes:g=3,defaultCdns:u=["unpkg","cdnjs","jsdelivr","staticfile"]}=j;let p;return{name:"vite-add-cdn-script",enforce:"pre",apply:"build",config(n){p=n},transformIndexHtml(n){const O=t.resolve(process.cwd(),"package.json");try{const s=u[0],N=r.readFileSync(O,"utf-8"),l=JSON.parse(N),h=p.build.rollupOptions.external;let c=""+`<script>
|
2
2
|
const separators = JSON.parse('${JSON.stringify(a)}');
|
3
3
|
const cdnUrlObj = JSON.parse('${JSON.stringify(o)}');
|
4
4
|
const defaultCdns = JSON.parse('${JSON.stringify(u)}');
|
package/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
interface IOptions {
|
2
|
-
protocol?: string;
|
3
|
-
customScript?: { [key: string]: string };
|
4
|
-
retryTimes?: number;
|
5
|
-
defaultCdns?: string[];
|
6
|
-
}
|
7
|
-
export default function viteAddCdnScript(options: IOptions);
|
1
|
+
interface IOptions {
|
2
|
+
protocol?: string;
|
3
|
+
customScript?: { [key: string]: string };
|
4
|
+
retryTimes?: number;
|
5
|
+
defaultCdns?: string[];
|
6
|
+
}
|
7
|
+
export default function viteAddCdnScript(options: IOptions);
|
package/package.json
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
{
|
2
|
-
"name": "vite-add-cdn-script",
|
3
|
-
"version": "0.0.
|
4
|
-
"keywords": [
|
5
|
-
"vite",
|
6
|
-
"cdn",
|
7
|
-
"cdn-script",
|
8
|
-
"auto-add-cdn",
|
9
|
-
"vite-add-cdn-script"
|
10
|
-
],
|
11
|
-
"description": "A plugin for vite to add cdn script to index.html",
|
12
|
-
"repository": {
|
13
|
-
"type": "git",
|
14
|
-
"url": "git+https://github.com/baizeteam/baize-vite-plugin.git"
|
15
|
-
},
|
16
|
-
"homepage": "https://github.com/baizeteam/baize-vite-plugin/tree/master/package/vite-add-cdn-script#readme",
|
17
|
-
"author": "baizeteam",
|
18
|
-
"type": "module",
|
19
|
-
"files": [
|
20
|
-
"dist",
|
21
|
-
"index.d.ts"
|
22
|
-
],
|
23
|
-
"main": "./dist/index.umd.cjs",
|
24
|
-
"module": "./dist/index.js",
|
25
|
-
"types": "./index.d.ts",
|
26
|
-
"exports": {
|
27
|
-
"types": "./index.d.ts",
|
28
|
-
"import": "./dist/index.js",
|
29
|
-
"require": "./dist/index.js"
|
30
|
-
},
|
31
|
-
"scripts": {
|
32
|
-
"dev": "vite",
|
33
|
-
"build": "tsc && vite build"
|
34
|
-
},
|
35
|
-
"devDependencies": {
|
36
|
-
"@types/node": "^20.12.11",
|
37
|
-
"@types/react": "^18.3.2",
|
38
|
-
"@types/react-dom": "^18.3.0",
|
39
|
-
"@vitejs/plugin-react": "^4.2.1",
|
40
|
-
"react": "^18.3.1",
|
41
|
-
"react-dom": "^18.3.1",
|
42
|
-
"rollup-plugin-node-externals": "^7.1.2",
|
43
|
-
"typescript": "^5.4.5",
|
44
|
-
"vite": "^5.2.11"
|
45
|
-
},
|
46
|
-
"publishConfig": {
|
47
|
-
"registry": "https://registry.npmjs.org/"
|
48
|
-
}
|
1
|
+
{
|
2
|
+
"name": "vite-add-cdn-script",
|
3
|
+
"version": "0.0.4",
|
4
|
+
"keywords": [
|
5
|
+
"vite",
|
6
|
+
"cdn",
|
7
|
+
"cdn-script",
|
8
|
+
"auto-add-cdn",
|
9
|
+
"vite-add-cdn-script"
|
10
|
+
],
|
11
|
+
"description": "A plugin for vite to add cdn script to index.html",
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/baizeteam/baize-vite-plugin.git"
|
15
|
+
},
|
16
|
+
"homepage": "https://github.com/baizeteam/baize-vite-plugin/tree/master/package/vite-add-cdn-script#readme",
|
17
|
+
"author": "baizeteam",
|
18
|
+
"type": "module",
|
19
|
+
"files": [
|
20
|
+
"dist",
|
21
|
+
"index.d.ts"
|
22
|
+
],
|
23
|
+
"main": "./dist/index.umd.cjs",
|
24
|
+
"module": "./dist/index.js",
|
25
|
+
"types": "./index.d.ts",
|
26
|
+
"exports": {
|
27
|
+
"types": "./index.d.ts",
|
28
|
+
"import": "./dist/index.js",
|
29
|
+
"require": "./dist/index.js"
|
30
|
+
},
|
31
|
+
"scripts": {
|
32
|
+
"dev": "vite",
|
33
|
+
"build": "tsc && vite build"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"@types/node": "^20.12.11",
|
37
|
+
"@types/react": "^18.3.2",
|
38
|
+
"@types/react-dom": "^18.3.0",
|
39
|
+
"@vitejs/plugin-react": "^4.2.1",
|
40
|
+
"react": "^18.3.1",
|
41
|
+
"react-dom": "^18.3.1",
|
42
|
+
"rollup-plugin-node-externals": "^7.1.2",
|
43
|
+
"typescript": "^5.4.5",
|
44
|
+
"vite": "^5.2.11"
|
45
|
+
},
|
46
|
+
"publishConfig": {
|
47
|
+
"registry": "https://registry.npmjs.org/"
|
48
|
+
}
|
49
49
|
}
|