unpkg-white-list 1.133.0 → 1.134.1
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/README.md +24 -4
- package/package.json +4328 -4336
package/README.md
CHANGED
|
@@ -7,10 +7,22 @@
|
|
|
7
7
|
|
|
8
8
|
## 添加白名单方式
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
> [!NOTE]
|
|
11
|
+
> 尽量使用 CLI 添加白名单,它可以确保字段顺序和格式正确,避免手动修改 `package.json` 文件。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### 添加指定包名和版本号
|
|
14
|
+
|
|
15
|
+
用 CLI 添加你想开启 unpkg 文件同步的 npm 包名和版本号,全量同步版本号可以设置为 `*`,以同步 [urllib](https://npmmirror.com/package/urllib) 为示例:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run add -- --pkg=urllib:* # 同步 urllib 所有版本
|
|
19
|
+
# or
|
|
20
|
+
npm run add -- --pkg=urllib:1.0.0 # 同步 urllib 1.0.0 版本
|
|
21
|
+
# or
|
|
22
|
+
npm run add -- "--pkg=urllib:>=1.0.0" # 同步 urllib 大于等于 1.0.0 版本
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
_你将会看到 package.json 文件中的 `allowPackages` 字段被更新,如下所示:_
|
|
14
26
|
|
|
15
27
|
```json
|
|
16
28
|
"allowPackages": {
|
|
@@ -22,7 +34,15 @@
|
|
|
22
34
|
}
|
|
23
35
|
```
|
|
24
36
|
|
|
25
|
-
|
|
37
|
+
### 添加指定 scope
|
|
38
|
+
|
|
39
|
+
当然你发布的是 scoped package,可以用 CLI 添加 scope 到白名单 `allowScopes`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run add -- --scope=@eggjs
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
_你将会看到 package.json 文件中的 `allowPackages` 字段被更新,如下所示:_
|
|
26
46
|
|
|
27
47
|
```json
|
|
28
48
|
"allowScopes": [
|