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.
@@ -101,7 +101,7 @@ class CDN {
101
101
  },
102
102
  {
103
103
  argName: 'flag',
104
- argValue: flags[index],
104
+ argValue: flags[index] || null,
105
105
  },
106
106
  ],
107
107
  functionName: 'back_to_origin_url_rewrite',
@@ -6,7 +6,8 @@ interface EndpointInfo {
6
6
  build: string;
7
7
  target: string;
8
8
  domain: string;
9
- defines: Define;
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
  }
@@ -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 ? endpoint.uri_rewrite : target.uri_rewrite;
68
- setRewriteUriPromises.push(
69
- setRewriteUri(
70
- endpoint.domain,
71
- `${uriRewrite.original_regexp ? uriRewrite.original_regexp : uriRewrite.original}`,
72
- `/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
73
- cdn
74
- )
75
- );
76
- urls.push(`https://${endpoint.domain}${uriRewrite.original}`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rigjs",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "A multi-repos dev tool based on yarn and git.Rig is inspired by cocoapods. Not like those monorepo solutions,rig is a tool for organizing multi-repos.",
5
5
  "keywords": [
6
6
  "modular",