@vearvip/vite-plugin-cdn-import 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -65,7 +65,7 @@ var modulesConfig = {
65
65
  jsdeliver: {
66
66
  path: isDev ? "umd/react.development.js" : "umd/react.production.min.js"
67
67
  },
68
- bootCdn: {
68
+ bootCdnOrStaticfile: {
69
69
  path: isDev ? "umd/react.development.js" : "umd/react.production.min.js"
70
70
  }
71
71
  },
@@ -75,7 +75,7 @@ var modulesConfig = {
75
75
  jsdeliver: {
76
76
  path: isDev ? "umd/react-dom.development.js" : "umd/react-dom.production.min.js"
77
77
  },
78
- bootCdn: {
78
+ bootCdnOrStaticfile: {
79
79
  path: isDev ? "umd/react-dom.development.js" : "umd/react-dom.production.min.js"
80
80
  }
81
81
  },
@@ -84,7 +84,7 @@ var modulesConfig = {
84
84
  jsdeliver: {
85
85
  path: "dist/umd/react-router-dom.production.min.js"
86
86
  },
87
- bootCdn: {
87
+ bootCdnOrStaticfile: {
88
88
  path: "umd/react-router-dom.production.min.js"
89
89
  }
90
90
  },
@@ -94,7 +94,7 @@ var modulesConfig = {
94
94
  path: "dist/antd.min.js",
95
95
  css: "dist/reset.min.css"
96
96
  },
97
- bootCdn: {
97
+ bootCdnOrStaticfile: {
98
98
  path: "antd.min.js",
99
99
  css: "reset.min.css"
100
100
  }
@@ -104,7 +104,7 @@ var modulesConfig = {
104
104
  jsdeliver: {
105
105
  path: isDev ? "dist/vue.runtime.global.js" : "dist/vue.runtime.global.prod.js"
106
106
  },
107
- bootCdn: {
107
+ bootCdnOrStaticfile: {
108
108
  path: isDev ? "vue.runtime.global.js" : "vue.runtime.global.prod.js"
109
109
  }
110
110
  },
@@ -113,7 +113,7 @@ var modulesConfig = {
113
113
  jsdeliver: {
114
114
  path: "dist/vue-router.global.min.js"
115
115
  },
116
- bootCdn: {
116
+ bootCdnOrStaticfile: {
117
117
  path: "vue-router.global.min.js"
118
118
  }
119
119
  },
@@ -123,7 +123,7 @@ var modulesConfig = {
123
123
  name: "vue-router",
124
124
  path: "dist/vue-router.min.js"
125
125
  },
126
- bootCdn: {
126
+ bootCdnOrStaticfile: {
127
127
  name: "vue-router",
128
128
  path: "vue-router.min.js"
129
129
  }
@@ -134,7 +134,7 @@ var modulesConfig = {
134
134
  name: "vue",
135
135
  path: isDev ? "dist/vue.runtime.js" : "dist/vue.runtime.min.js"
136
136
  },
137
- bootCdn: {
137
+ bootCdnOrStaticfile: {
138
138
  name: "vue",
139
139
  path: isDev ? "vue.runtime.js" : "vue.runtime.min.js"
140
140
  }
@@ -144,7 +144,7 @@ var modulesConfig = {
144
144
  jsdeliver: {
145
145
  path: "moment.min.js"
146
146
  },
147
- bootCdn: {
147
+ bootCdnOrStaticfile: {
148
148
  path: "moment.min.js"
149
149
  }
150
150
  },
@@ -153,7 +153,7 @@ var modulesConfig = {
153
153
  jsdeliver: {
154
154
  path: "dayjs.min.js"
155
155
  },
156
- bootCdn: {
156
+ bootCdnOrStaticfile: {
157
157
  path: "dayjs.min.js"
158
158
  }
159
159
  },
@@ -162,7 +162,7 @@ var modulesConfig = {
162
162
  jsdeliver: {
163
163
  path: "dist/axios.min.js"
164
164
  },
165
- bootCdn: {
165
+ bootCdnOrStaticfile: {
166
166
  path: "axios.min.js"
167
167
  }
168
168
  },
@@ -171,7 +171,7 @@ var modulesConfig = {
171
171
  jsdeliver: {
172
172
  path: "lodash.min.js"
173
173
  },
174
- bootCdn: {
174
+ bootCdnOrStaticfile: {
175
175
  path: "lodash.min.js"
176
176
  }
177
177
  }
@@ -185,8 +185,8 @@ function isUnpkg(prodUrl) {
185
185
  function isCdnjs(prodUrl) {
186
186
  return prodUrl.includes("//cdnjs.cloudflare.com");
187
187
  }
188
- function isBootCdn(prodUrl) {
189
- return prodUrl.includes("//cdn.bootcdn.net");
188
+ function isBootCdnOrStaticfile(prodUrl) {
189
+ return prodUrl.includes("//cdn.bootcdn.net") || prodUrl.includes("//cdn.staticfile.net");
190
190
  }
191
191
  function genModuleByName(name) {
192
192
  const config = modulesConfig[name];
@@ -199,7 +199,7 @@ function genModuleByName(name) {
199
199
  `The configuration of module ${name} in ${prodUrl} does not exist `
200
200
  );
201
201
  } else {
202
- if (!isJsdeliver(prodUrl) || !isUnpkg(prodUrl) || !isCdnjs(prodUrl) || !isBootCdn(prodUrl)) {
202
+ if (!isJsdeliver(prodUrl) || !isUnpkg(prodUrl) || !isCdnjs(prodUrl) || !isBootCdnOrStaticfile(prodUrl)) {
203
203
  console.warn(
204
204
  "Unknown CDN, please ensure that this CDN supports jsdelivr rules"
205
205
  );
@@ -208,7 +208,7 @@ function genModuleByName(name) {
208
208
  name,
209
209
  var: config.var,
210
210
  alias: config.alias
211
- }, isBootCdn(prodUrl) ? config.bootCdn : config.jsdeliver);
211
+ }, isBootCdnOrStaticfile(prodUrl) ? config.bootCdnOrStaticfile : config.jsdeliver);
212
212
  }
213
213
  };
214
214
  }
package/dist/index.d.cts CHANGED
@@ -9,7 +9,7 @@ declare const modulesConfig: {
9
9
  jsdeliver: {
10
10
  path: string;
11
11
  };
12
- bootCdn: {
12
+ bootCdnOrStaticfile: {
13
13
  path: string;
14
14
  };
15
15
  };
@@ -19,7 +19,7 @@ declare const modulesConfig: {
19
19
  jsdeliver: {
20
20
  path: string;
21
21
  };
22
- bootCdn: {
22
+ bootCdnOrStaticfile: {
23
23
  path: string;
24
24
  };
25
25
  };
@@ -28,7 +28,7 @@ declare const modulesConfig: {
28
28
  jsdeliver: {
29
29
  path: string;
30
30
  };
31
- bootCdn: {
31
+ bootCdnOrStaticfile: {
32
32
  path: string;
33
33
  };
34
34
  };
@@ -38,7 +38,7 @@ declare const modulesConfig: {
38
38
  path: string;
39
39
  css: string;
40
40
  };
41
- bootCdn: {
41
+ bootCdnOrStaticfile: {
42
42
  path: string;
43
43
  css: string;
44
44
  };
@@ -48,7 +48,7 @@ declare const modulesConfig: {
48
48
  jsdeliver: {
49
49
  path: string;
50
50
  };
51
- bootCdn: {
51
+ bootCdnOrStaticfile: {
52
52
  path: string;
53
53
  };
54
54
  };
@@ -57,7 +57,7 @@ declare const modulesConfig: {
57
57
  jsdeliver: {
58
58
  path: string;
59
59
  };
60
- bootCdn: {
60
+ bootCdnOrStaticfile: {
61
61
  path: string;
62
62
  };
63
63
  };
@@ -67,7 +67,7 @@ declare const modulesConfig: {
67
67
  name: string;
68
68
  path: string;
69
69
  };
70
- bootCdn: {
70
+ bootCdnOrStaticfile: {
71
71
  name: string;
72
72
  path: string;
73
73
  };
@@ -78,7 +78,7 @@ declare const modulesConfig: {
78
78
  name: string;
79
79
  path: string;
80
80
  };
81
- bootCdn: {
81
+ bootCdnOrStaticfile: {
82
82
  name: string;
83
83
  path: string;
84
84
  };
@@ -88,7 +88,7 @@ declare const modulesConfig: {
88
88
  jsdeliver: {
89
89
  path: string;
90
90
  };
91
- bootCdn: {
91
+ bootCdnOrStaticfile: {
92
92
  path: string;
93
93
  };
94
94
  };
@@ -97,7 +97,7 @@ declare const modulesConfig: {
97
97
  jsdeliver: {
98
98
  path: string;
99
99
  };
100
- bootCdn: {
100
+ bootCdnOrStaticfile: {
101
101
  path: string;
102
102
  };
103
103
  };
@@ -106,7 +106,7 @@ declare const modulesConfig: {
106
106
  jsdeliver: {
107
107
  path: string;
108
108
  };
109
- bootCdn: {
109
+ bootCdnOrStaticfile: {
110
110
  path: string;
111
111
  };
112
112
  };
@@ -115,7 +115,7 @@ declare const modulesConfig: {
115
115
  jsdeliver: {
116
116
  path: string;
117
117
  };
118
- bootCdn: {
118
+ bootCdnOrStaticfile: {
119
119
  path: string;
120
120
  };
121
121
  };
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ declare const modulesConfig: {
9
9
  jsdeliver: {
10
10
  path: string;
11
11
  };
12
- bootCdn: {
12
+ bootCdnOrStaticfile: {
13
13
  path: string;
14
14
  };
15
15
  };
@@ -19,7 +19,7 @@ declare const modulesConfig: {
19
19
  jsdeliver: {
20
20
  path: string;
21
21
  };
22
- bootCdn: {
22
+ bootCdnOrStaticfile: {
23
23
  path: string;
24
24
  };
25
25
  };
@@ -28,7 +28,7 @@ declare const modulesConfig: {
28
28
  jsdeliver: {
29
29
  path: string;
30
30
  };
31
- bootCdn: {
31
+ bootCdnOrStaticfile: {
32
32
  path: string;
33
33
  };
34
34
  };
@@ -38,7 +38,7 @@ declare const modulesConfig: {
38
38
  path: string;
39
39
  css: string;
40
40
  };
41
- bootCdn: {
41
+ bootCdnOrStaticfile: {
42
42
  path: string;
43
43
  css: string;
44
44
  };
@@ -48,7 +48,7 @@ declare const modulesConfig: {
48
48
  jsdeliver: {
49
49
  path: string;
50
50
  };
51
- bootCdn: {
51
+ bootCdnOrStaticfile: {
52
52
  path: string;
53
53
  };
54
54
  };
@@ -57,7 +57,7 @@ declare const modulesConfig: {
57
57
  jsdeliver: {
58
58
  path: string;
59
59
  };
60
- bootCdn: {
60
+ bootCdnOrStaticfile: {
61
61
  path: string;
62
62
  };
63
63
  };
@@ -67,7 +67,7 @@ declare const modulesConfig: {
67
67
  name: string;
68
68
  path: string;
69
69
  };
70
- bootCdn: {
70
+ bootCdnOrStaticfile: {
71
71
  name: string;
72
72
  path: string;
73
73
  };
@@ -78,7 +78,7 @@ declare const modulesConfig: {
78
78
  name: string;
79
79
  path: string;
80
80
  };
81
- bootCdn: {
81
+ bootCdnOrStaticfile: {
82
82
  name: string;
83
83
  path: string;
84
84
  };
@@ -88,7 +88,7 @@ declare const modulesConfig: {
88
88
  jsdeliver: {
89
89
  path: string;
90
90
  };
91
- bootCdn: {
91
+ bootCdnOrStaticfile: {
92
92
  path: string;
93
93
  };
94
94
  };
@@ -97,7 +97,7 @@ declare const modulesConfig: {
97
97
  jsdeliver: {
98
98
  path: string;
99
99
  };
100
- bootCdn: {
100
+ bootCdnOrStaticfile: {
101
101
  path: string;
102
102
  };
103
103
  };
@@ -106,7 +106,7 @@ declare const modulesConfig: {
106
106
  jsdeliver: {
107
107
  path: string;
108
108
  };
109
- bootCdn: {
109
+ bootCdnOrStaticfile: {
110
110
  path: string;
111
111
  };
112
112
  };
@@ -115,7 +115,7 @@ declare const modulesConfig: {
115
115
  jsdeliver: {
116
116
  path: string;
117
117
  };
118
- bootCdn: {
118
+ bootCdnOrStaticfile: {
119
119
  path: string;
120
120
  };
121
121
  };
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var modulesConfig = {
32
32
  jsdeliver: {
33
33
  path: isDev ? "umd/react.development.js" : "umd/react.production.min.js"
34
34
  },
35
- bootCdn: {
35
+ bootCdnOrStaticfile: {
36
36
  path: isDev ? "umd/react.development.js" : "umd/react.production.min.js"
37
37
  }
38
38
  },
@@ -42,7 +42,7 @@ var modulesConfig = {
42
42
  jsdeliver: {
43
43
  path: isDev ? "umd/react-dom.development.js" : "umd/react-dom.production.min.js"
44
44
  },
45
- bootCdn: {
45
+ bootCdnOrStaticfile: {
46
46
  path: isDev ? "umd/react-dom.development.js" : "umd/react-dom.production.min.js"
47
47
  }
48
48
  },
@@ -51,7 +51,7 @@ var modulesConfig = {
51
51
  jsdeliver: {
52
52
  path: "dist/umd/react-router-dom.production.min.js"
53
53
  },
54
- bootCdn: {
54
+ bootCdnOrStaticfile: {
55
55
  path: "umd/react-router-dom.production.min.js"
56
56
  }
57
57
  },
@@ -61,7 +61,7 @@ var modulesConfig = {
61
61
  path: "dist/antd.min.js",
62
62
  css: "dist/reset.min.css"
63
63
  },
64
- bootCdn: {
64
+ bootCdnOrStaticfile: {
65
65
  path: "antd.min.js",
66
66
  css: "reset.min.css"
67
67
  }
@@ -71,7 +71,7 @@ var modulesConfig = {
71
71
  jsdeliver: {
72
72
  path: isDev ? "dist/vue.runtime.global.js" : "dist/vue.runtime.global.prod.js"
73
73
  },
74
- bootCdn: {
74
+ bootCdnOrStaticfile: {
75
75
  path: isDev ? "vue.runtime.global.js" : "vue.runtime.global.prod.js"
76
76
  }
77
77
  },
@@ -80,7 +80,7 @@ var modulesConfig = {
80
80
  jsdeliver: {
81
81
  path: "dist/vue-router.global.min.js"
82
82
  },
83
- bootCdn: {
83
+ bootCdnOrStaticfile: {
84
84
  path: "vue-router.global.min.js"
85
85
  }
86
86
  },
@@ -90,7 +90,7 @@ var modulesConfig = {
90
90
  name: "vue-router",
91
91
  path: "dist/vue-router.min.js"
92
92
  },
93
- bootCdn: {
93
+ bootCdnOrStaticfile: {
94
94
  name: "vue-router",
95
95
  path: "vue-router.min.js"
96
96
  }
@@ -101,7 +101,7 @@ var modulesConfig = {
101
101
  name: "vue",
102
102
  path: isDev ? "dist/vue.runtime.js" : "dist/vue.runtime.min.js"
103
103
  },
104
- bootCdn: {
104
+ bootCdnOrStaticfile: {
105
105
  name: "vue",
106
106
  path: isDev ? "vue.runtime.js" : "vue.runtime.min.js"
107
107
  }
@@ -111,7 +111,7 @@ var modulesConfig = {
111
111
  jsdeliver: {
112
112
  path: "moment.min.js"
113
113
  },
114
- bootCdn: {
114
+ bootCdnOrStaticfile: {
115
115
  path: "moment.min.js"
116
116
  }
117
117
  },
@@ -120,7 +120,7 @@ var modulesConfig = {
120
120
  jsdeliver: {
121
121
  path: "dayjs.min.js"
122
122
  },
123
- bootCdn: {
123
+ bootCdnOrStaticfile: {
124
124
  path: "dayjs.min.js"
125
125
  }
126
126
  },
@@ -129,7 +129,7 @@ var modulesConfig = {
129
129
  jsdeliver: {
130
130
  path: "dist/axios.min.js"
131
131
  },
132
- bootCdn: {
132
+ bootCdnOrStaticfile: {
133
133
  path: "axios.min.js"
134
134
  }
135
135
  },
@@ -138,7 +138,7 @@ var modulesConfig = {
138
138
  jsdeliver: {
139
139
  path: "lodash.min.js"
140
140
  },
141
- bootCdn: {
141
+ bootCdnOrStaticfile: {
142
142
  path: "lodash.min.js"
143
143
  }
144
144
  }
@@ -152,8 +152,8 @@ function isUnpkg(prodUrl) {
152
152
  function isCdnjs(prodUrl) {
153
153
  return prodUrl.includes("//cdnjs.cloudflare.com");
154
154
  }
155
- function isBootCdn(prodUrl) {
156
- return prodUrl.includes("//cdn.bootcdn.net");
155
+ function isBootCdnOrStaticfile(prodUrl) {
156
+ return prodUrl.includes("//cdn.bootcdn.net") || prodUrl.includes("//cdn.staticfile.net");
157
157
  }
158
158
  function genModuleByName(name) {
159
159
  const config = modulesConfig[name];
@@ -166,7 +166,7 @@ function genModuleByName(name) {
166
166
  `The configuration of module ${name} in ${prodUrl} does not exist `
167
167
  );
168
168
  } else {
169
- if (!isJsdeliver(prodUrl) || !isUnpkg(prodUrl) || !isCdnjs(prodUrl) || !isBootCdn(prodUrl)) {
169
+ if (!isJsdeliver(prodUrl) || !isUnpkg(prodUrl) || !isCdnjs(prodUrl) || !isBootCdnOrStaticfile(prodUrl)) {
170
170
  console.warn(
171
171
  "Unknown CDN, please ensure that this CDN supports jsdelivr rules"
172
172
  );
@@ -175,7 +175,7 @@ function genModuleByName(name) {
175
175
  name,
176
176
  var: config.var,
177
177
  alias: config.alias
178
- }, isBootCdn(prodUrl) ? config.bootCdn : config.jsdeliver);
178
+ }, isBootCdnOrStaticfile(prodUrl) ? config.bootCdnOrStaticfile : config.jsdeliver);
179
179
  }
180
180
  };
181
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vearvip/vite-plugin-cdn-import",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Import packages from CDN for the vite plugin",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",