rigjs 2.0.4 → 2.0.5
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/built/index.js +71 -71
- package/lib/classes/cicd/Deploy/CDN.ts +1 -1
- package/lib/classes/cicd/Endpoint.ts +4 -1
- package/lib/publish/index.ts +19 -10
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ interface EndpointInfo {
|
|
|
6
6
|
build: string;
|
|
7
7
|
target: string;
|
|
8
8
|
domain: string;
|
|
9
|
-
|
|
9
|
+
domains: string[];
|
|
10
|
+
defines: Define;
|
|
10
11
|
uri_rewrite: {
|
|
11
12
|
original: string;
|
|
12
13
|
original_regexp: string;
|
|
@@ -25,6 +26,7 @@ class Endpoint {
|
|
|
25
26
|
target: string;
|
|
26
27
|
build: string;
|
|
27
28
|
domain: string;
|
|
29
|
+
domains: string[];
|
|
28
30
|
deployDir: string = '';
|
|
29
31
|
|
|
30
32
|
publicPath: string = '';
|
|
@@ -51,6 +53,7 @@ class Endpoint {
|
|
|
51
53
|
this.target = info.target;
|
|
52
54
|
this.build = info.build;
|
|
53
55
|
this.domain = info.domain;
|
|
56
|
+
this.domains = info.domains
|
|
54
57
|
this.defines = info.defines;
|
|
55
58
|
this.uri_rewrite = info.uri_rewrite;
|
|
56
59
|
}
|
package/lib/publish/index.ts
CHANGED
|
@@ -64,16 +64,25 @@ export default async (cmd: any) => {
|
|
|
64
64
|
const urls: string[] = [];
|
|
65
65
|
const setRewriteUriPromises: Promise<any>[] = [];
|
|
66
66
|
for (const endpoint of cicdCmd.endpoints) {
|
|
67
|
-
const uriRewrite = endpoint.uri_rewrite
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
const uriRewrite = endpoint.uri_rewrite
|
|
68
|
+
? endpoint.uri_rewrite
|
|
69
|
+
: target.uri_rewrite;
|
|
70
|
+
|
|
71
|
+
for (const domain of endpoint.domains) {
|
|
72
|
+
setRewriteUriPromises.push(
|
|
73
|
+
setRewriteUri(
|
|
74
|
+
domain,
|
|
75
|
+
`${
|
|
76
|
+
uriRewrite.original_regexp
|
|
77
|
+
? uriRewrite.original_regexp
|
|
78
|
+
: uriRewrite.original
|
|
79
|
+
}`,
|
|
80
|
+
`/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
|
|
81
|
+
cdn
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
urls.push(`https://${domain}${uriRewrite.original}`);
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
// 回源URI改写
|
package/package.json
CHANGED