Skip to content

Commit

Permalink
fix(packages): change to use unpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Jul 12, 2024
1 parent 408a2a6 commit d85a700
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/server/configs/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ npm:
proxy: false
cdn:
apiUrl: https://data.jsdelivr.com
mirror: https://jsd.onmicrosoft.cn
# mirror: https://jsd.onmicrosoft.cn/npm
mirror: http://dev-unpkg.tenxcloud.net
unpkg: http://dev-unpkg.tenxcloud.net
kubernetes:
# k8s 集群配置
Expand Down
6 changes: 3 additions & 3 deletions packages/server/src/apps/templates/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"id": "antd",
"meta": {},
"urls": [
"https://jsd.onmicrosoft.cn/npm/antd@5.13.1/dist/antd.min.js",
"https://jsd.onmicrosoft.cn/npm/antd@5.13.1/dist/reset.min.css"
"http://dev-unpkg.tenxcloud.net/antd@5.13.1/dist/antd.min.js",
"http://dev-unpkg.tenxcloud.net/antd@5.13.1/dist/reset.min.css"
],
"library": "antd",
"package": "antd",
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"id": "lodash",
"meta": null,
"urls": ["https://jsd.onmicrosoft.cn/npm/lodash@4.17.21/lodash.min.js"],
"urls": ["http://dev-unpkg.tenxcloud.net/lodash@4.17.21/lodash.min.js"],
"library": "_",
"package": "lodash",
"version": "4.17.21",
Expand Down
6 changes: 3 additions & 3 deletions packages/server/src/components/templates/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"id": "antd",
"meta": {},
"urls": [
"https://jsd.onmicrosoft.cn/npm/antd@5.13.1/dist/antd.min.js",
"https://jsd.onmicrosoft.cn/npm/antd@5.13.1/dist/reset.min.css"
"http://dev-unpkg.tenxcloud.net/antd@5.13.1/dist/antd.min.js",
"http://dev-unpkg.tenxcloud.net/antd@5.13.1/dist/reset.min.css"
],
"library": "antd",
"package": "antd",
Expand Down Expand Up @@ -67,7 +67,7 @@
{
"id": "lodash",
"meta": null,
"urls": ["https://jsd.onmicrosoft.cn/npm/lodash@4.17.21/lodash.min.js"],
"urls": ["http://dev-unpkg.tenxcloud.net/lodash@4.17.21/lodash.min.js"],
"library": "_",
"package": "lodash",
"version": "4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/packages/packages.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class PackagesService {
const { cdn, unpkg } = this.config.npm || {};
const fullName = `${name}@${pkg.version}`;
const isTenxPackage = this.isTenxPackage(name);
const cdnServer = isTenxPackage ? unpkg : `${cdn.mirror}/npm`;
const cdnServer = isTenxPackage ? unpkg : cdn.mirror;
if (pkg.yunti) {
const {
umd: { library, entry, externals },
Expand Down

0 comments on commit d85a700

Please sign in to comment.