@@ -78,46 +78,69 @@ ss -a
78
78
79
79
### CDN 资源
80
80
81
- - [ 360 前端静态资源库] ( https://cdn.baomitu.com ) 由奇舞团支持并维护的开源项目免费 CDN 服务,支持 HTTPS 和 HTTP/2,囊括上千个前端资源库和 Google 字体库。
82
- - [ staticfile:] ( http://www.staticfile.org ) 七牛云提供 CDN,掘金提供技术支持,同步 [ cdnjs] ( https://github.com/cdnjs/cdnjs ) 服务资源
83
- - [ bootcdn:] ( https://www.bootcdn.cn ) 极兔云联合 Bootstrap中文网共同支持并维护的前端开源项目免费 CDN 服务
84
- - [ 字节跳动静态资源公共库] ( https://cdn.bytedance.com )
85
- - [ jsdelivr] ( https://www.jsdelivr.com ) 支持 npm 包、github 仓库
86
- - 官方CDN地址:https://cdn.jsdelivr.net
87
- - [ unpkg] 格式:https://cdn.jsdelivr.net/npm/package@version/file
88
- - [ github] 格式:https://cdn.jsdelivr.net/gh/user/repo@branch/file
89
- - [ wordpress plugin] 格式:https://cdn.jsdelivr.net/wp/plugins/project/tags/version/file
90
- - 示例:
91
- - https://cdn.jsdelivr.net/npm/console-log-colors@latest/package.json
92
- - https://cdn.jsdelivr.net/gh/lzwme/console-log-colors@main/package.json
93
- - [ wordpress plugin] 格式:https://cdn.jsdelivr.net/wp/plugins/wp-slimstat/tags/4.6.5/wp-slimstat.js
94
- - ` zhimg(知乎) `
95
- - [ unpkg
] 示例:
https://unpkg.zhimg.com/[email protected] /dist/jquery.min.js
96
- - ` elemecdn(饿了么) `
97
- - [ unpkg] 示例:https://npm.elemecdn.com/jquery@3/dist/jquery.min.js
98
- - [ github] 示例:https://github.elemecdn.com/jquery/
81
+ - [ Zstatic CDN] ( https://www.zstatic.net ) 由又拍云赞助。` 支持 SRI! `
82
+ - [ staticfile:] ( http://www.staticfile.org ) 七牛云提供 CDN,掘金提供技术支持,同步 [ cdnjs] ( https://github.com/cdnjs/cdnjs ) 服务资源。` 支持 SRI! `
83
+ - [ 知乎npm: https://unpkg.zhimg.com ] ( https://unpkg.zhimg.com ) 未公开。企业级服务,内外网均可访问。支持的包不太多。
84
+ - [ 360 前端静态资源库] ( https://cdn.baomitu.com ) ** 不支持外网。** ` 支持 SRI! ` 由奇舞团支持并维护的开源项目免费 CDN 服务,支持 HTTPS 和 HTTP/2,囊括上千个前端资源库和 Google 字体库。
85
+ - [ 饿了么npm: https://npm.elemecdn.com ] ( https://npm.elemecdn.com ) 未公开。企业级服务,** 不支持外网。**
86
+ - [ 字节跳动静态资源公共库] ( https://cdn.bytedance.com ) 同步 cdnjs 资源。缓存过期时间最长设置一年。** 自 2022 年 3 月起,静态资源已不再更新** 。
87
+ - [ bootcdn: https://www.bootcdn.cn ] ( https://www.bootcdn.cn ) 极兔云联合 Bootstrap 中文网共同支持并维护的前端开源项目免费 CDN 服务。** 常出现不稳定的现象**
88
+ - [ jsdelivr: https://cdn.jsdelivr.net ] ( https://www.jsdelivr.com ) 支持 npm 包、github 仓库。** 国内不稳定**
99
89
- [ cdnjs] ( https://cdnjs.com ) [ (github)] ( https://github.com/cdnjs/cdnjs ) 上面许多 CDN 资源均是基于 cdnjs 同步的
100
- - https://statically.io
90
+ - [ beecdn.com] ( https://www.beecdn.com/all.html ) 基于 CDNJS.COM 的前端开源库文件快速浏览搜索平台
91
+ - https://statically.io ** 国内不稳定**
101
92
- https://www.sourcegcdn.com
102
93
94
+ ` unpkg / gh / wp ` :
95
+
96
+ - ` gh(github) `
97
+ - 格式:https://cdn.jsdelivr.net/gh/user/repo@branch/file
98
+ - 示例:https://cdn.jsdelivr.net/gh/lzwme/console-log-colors@main/package.json
99
+ - 饿了么 github。示例:https://github.elemecdn.com/jquery/
100
+ - statically(国内不稳定):https://cdn.statically.io/gh/:user/:repo/:tag/:file
101
+ - ` unpkg `
102
+ - unpkg 官方
103
+ - 示例:
https://unpkg.com/[email protected] /dist/jquery.min.js
104
+ - npmmirror 镜像,大厂稳定资源,但** 外网不可访问**
105
+ - 示例:https://registry.npmmirror.com/jquery/3.7.1/files/dist/jquery.min.js
106
+ - jsdelivr 服务,由于不在国内,时常存在不可访问的问题
107
+ - [ unpkg] 格式:https://cdn.jsdelivr.net/npm/package@version/file
108
+ - 示例:https://cdn.jsdelivr.net/npm/console-log-colors@latest/package.json
109
+ - [ 知乎unpkg
] 示例:
https://unpkg.zhimg.com/[email protected] /dist/jquery.min.js
110
+ - [ 饿了么unpkg] 示例:https://npm.elemecdn.com/jquery@3/dist/jquery.min.js
111
+ - ` wordpress `
112
+ - 格式:https://cdn.jsdelivr.net/wp/plugins/project/tags/version/file
113
+ - 示例:https://cdn.jsdelivr.net/wp/plugins/wp-slimstat/tags/4.6.5/wp-slimstat.js
114
+
103
115
** CDN 引用示例:**
104
116
117
+ 建议加上 ` integrity ` 属性,以防止供应链被攻击导致受到影响。可以从以下地址查询具体资源文件的 ` integrity ` 值。
118
+
119
+ - [ https://lzw.me/x/srihash/ ] ( https://lzw.me/x/srihash/ )
120
+ - [ https://www.srihash.org ] ( https://www.srihash.org )
121
+ - [ https://cdn.jsdelivr.net ] ( https://cdn.jsdelivr.net )
122
+
105
123
``` html
124
+ <!-- jsdelivr -->
125
+ <
script src =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.min.js" integrity =
" sha256-3gQJhtmj7YnV1fmtbVcnAV6eI4ws0Tr48bVZCThtCGQ=" crossorigin =
" anonymous" ></
script >
126
+ <
link rel =
" stylesheet" href =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/css/bootstrap.min.css" integrity =
" sha256-PI8n5gCcz9cQqQXm3PEtDuPG8qx9oFsFctPg0S5zb8g=" crossorigin =
" anonymous" >
127
+
106
128
<!-- bootcdn -->
107
129
<script src =" https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.min.js" ></script >
108
-
109
- <!-- jsdelivr -->
110
- <
link rel =
" stylesheet" href =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/css/bootstrap.min.css" integrity =
" sha256-wLz3iY/cO4e6vKZ4zRmo4+9XDpMcgKOvv/zEU3OMlRo=" crossorigin =
" anonymous" >
111
- <
script src =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.min.js" integrity =
" sha256-m81NDyncZVbr7v9E6qCWXwx/cwjuWDlHCMzi9pjMobA=" crossorigin =
" anonymous" ></
script >
112
130
```
113
131
114
132
常用参考:
133
+
115
134
<details >
116
135
<summary >jQuery</summary >
117
136
118
137
``` html
119
138
<!-- jquery3 -->
120
- <script crossorigin =" anonymous" src =" https://npm.elemecdn.com/jquery/dist/jquery.min.js" ></script >
139
+ <
script src =
" https://unpkg.zhimg.com/[email protected] /dist/jquery.min.js" crossorigin =
" anonymous" ></
script >
140
+
141
+ <script src =" https://npm.elemecdn.com/jquery/dist/jquery.min.js" crossorigin =" anonymous" ></script >
142
+
143
+ <script src =" https://cdn.bootcss.com/jquery/3.7.1/jquery.min.js" crossorigin =" anonymous" ></script >
121
144
122
145
<script crossorigin =" anonymous" integrity =" sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" src =" https://lib.baomitu.com/jquery/3.6.3/jquery.min.js" ></script >
123
146
@@ -142,6 +165,13 @@ https://unpkg.zhimg.com/jquery/
142
165
<summary >Bootstrap</summary >
143
166
144
167
``` html
168
+ <!-- bootstrap 5 -->
169
+ <
link crossorigin =
" anonymous" href =
" https://unpkg.zhimg.com/[email protected] /dist/css/bootstrap.min.css" rel =
" stylesheet" >
170
+ <
script crossorigin =
" anonymous" src =
" https://unpkg.zhimg.com/[email protected] /dist/js/bootstrap.min.js" ></
script >
171
+
172
+ <link crossorigin =" anonymous" integrity =" sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" href =" https://lib.baomitu.com/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel =" stylesheet" >
173
+ <script crossorigin =" anonymous" integrity =" sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g==" src =" https://lib.baomitu.com/twitter-bootstrap/5.2.3/js/bootstrap.min.js" ></script >
174
+
145
175
<!-- bootstrap 3 -->
146
176
<link crossorigin =" anonymous" href =" https://lib.baomitu.com/bootstrap@3/dist/css/bootstrap.min.css" rel =" stylesheet" >
147
177
<script crossorigin =" anonymous" src =" https://npm.elemecdn.com/bootstrap@3/dist/js/bootstrap.min.js" ></script >
@@ -153,10 +183,6 @@ https://unpkg.zhimg.com/jquery/
153
183
<link crossorigin =" anonymous" integrity =" sha512-T584yQ/tdRR5QwOpfvDfVQUidzfgc2339Lc8uBDtcp/wYu80d7jwBgAxbyMh0a9YM9F8N3tdErpFI8iaGx6x5g==" href =" https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" rel =" stylesheet" >
154
184
<script crossorigin =" anonymous" integrity =" sha512-UR25UO94eTnCVwjbXozyeVd6ZqpaAE9naiEUBK/A+QDbfSTQFhPGj5lOR6d8tsgbBk84Ggb5A3EkjsOgPRPcKA==" src =" https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script >
155
185
156
- <!-- bootstrap 5 -->
157
- <link crossorigin =" anonymous" integrity =" sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" href =" https://lib.baomitu.com/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel =" stylesheet" >
158
- <script crossorigin =" anonymous" integrity =" sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g==" src =" https://lib.baomitu.com/twitter-bootstrap/5.2.3/js/bootstrap.min.js" ></script >
159
-
160
186
<!-- 其他
161
187
https://cdn.jsdelivr.net/npm/twitter-bootstrap/
162
188
https://npm.elemecdn.com/twitter-bootstrap/
@@ -170,27 +196,32 @@ https://unpkg.zhimg.com/bootstrap/
170
196
<summary >font-awesome</summary >
171
197
172
198
``` html
173
- <!-- font-awesome 4.7 -->
174
- <link crossorigin =" anonymous" integrity =" sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" href =" https://lib.baomitu.com/font-awesome/4.7.0/css/font-awesome.min.css" rel =" stylesheet" >
175
-
176
- <
link rel =
" stylesheet" href =
" https://npm.elemecdn.com/[email protected] /css/font-awesome.min.css" crossorigin =
" anonymous" >
199
+ <!-- font-awesome latest all -->
177
200
178
- <!-- font-awesome 6.2 -->
179
- <link crossorigin =" anonymous" integrity =" sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" href =" https://lib.baomitu.com/font-awesome/6.2.1/css/all.min.css" rel =" stylesheet" >
201
+ <!-- css 方式引入:会渲染为 font 字体格式 -->
202
+ <link rel =" stylesheet" href =" https://s4.zstatic.net/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity =" sha256-5eIC48iZUHmSlSUz9XtjRyK2mzQkHScZY1WdMaoz74E=" crossorigin =" anonymous" >
203
+ <link href =" https://cdn.staticfile.net/font-awesome/6.6.0/css/all.min.css" rel =" stylesheet" crossorigin =" anonymous" >
180
204
181
- <
link rel =
" stylesheet" href =
" https://npm.elemecdn.com/@fortawesome/[email protected] /css/fontawesome.min.css" crossorigin =
" anonymous" >
205
+ <!-- js 方式引入:会渲染为 svg 格式 -->
206
+ <
script src =
" https://npm.elemecdn.com/@fortawesome/[email protected] /js/all.min.js" crossorigin =
" anonymous" ></
script >
182
207
183
- <!-- font-awesome latest all -- >
184
- <link crossorigin = " anonymous " integrity = " sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A== " href = " https://lib.baomitu.com/ font-awesome/latest/css /all.min.css " rel = " stylesheet " >
208
+ <link href = " https://cdn.bootcdn.net/ajax/libs/ font-awesome/6.4.0/css/ all.min.css " rel = " stylesheet " crossorigin = " anonymous " >
209
+ <script src = " https://cdn.bootcdn.net/ajax/libs/ font-awesome/6.4.0/js /all.min.js " crossorigin = " anonymous " ></ script >
185
210
186
- <link rel =" stylesheet" href =" https://jsdelivr.ioiox.cn/npm/@fortawesome/fontawesome-free/css/all.min.css" >
211
+ <link href =" https://lib.baomitu.com/font-awesome/latest/css/all.min.css" rel =" stylesheet" crossorigin =" anonymous" integrity =" sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" > <!-- font-awesome 5.8.1 -->
212
+ <link href =" https://lib.baomitu.com/font-awesome/6.2.1/css/all.min.css" rel =" stylesheet" crossorigin =" anonymous" integrity =" sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" >
213
+ <script src =" https://lib.baomitu.com/font-awesome/6.2.1/js/all.min.js" crossorigin =" anonymous" ></script >
187
214
188
- <link href =" https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel =" stylesheet" >
189
215
190
216
<!-- fontawesome-free latest https://npm.elemecdn.com/fontawesome-free/ -->
191
- <link rel = " stylesheet " href =" https://npm.elemecdn.com/@fortawesome/fontawesome-free/css/fontawesome.min.css" crossorigin =" anonymous" >
217
+ <link href =" https://npm.elemecdn.com/@fortawesome/fontawesome-free/css/fontawesome.min.css" rel = " stylesheet " crossorigin =" anonymous" >
192
218
<script src =" https://npm.elemecdn.com/@fortawesome/fontawesome-free/js/fontawesome.min.js" crossorigin =" anonymous" ></script >
193
219
220
+ <!-- font-awesome 4.7 -->
221
+ <link href =" https://lib.baomitu.com/font-awesome/4.7.0/css/font-awesome.min.css" rel =" stylesheet" crossorigin =" anonymous" integrity =" sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" >
222
+
223
+ <
link href =
" https://npm.elemecdn.com/[email protected] /css/font-awesome.min.css" rel =
" stylesheet" crossorigin =
" anonymous" >
224
+
194
225
<!-- 其他
195
226
https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/
196
227
https://npm.elemecdn.com/@fortawesome/fontawesome-free/
0 commit comments