rigjs 2.1.20 → 2.1.21

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.
@@ -94,7 +94,7 @@ export default async (cmd: any) => {
94
94
  }
95
95
  for (const domain of endpoint.domains) {
96
96
  if (cicd.web_type === 'mpa') {
97
- //文件
97
+ //mpa匹配文件
98
98
  setRewriteUriPromises.push(
99
99
  setRewriteUri(
100
100
  domain,
@@ -103,7 +103,7 @@ export default async (cmd: any) => {
103
103
  cdn
104
104
  )
105
105
  );
106
- //非首页
106
+ //mpa匹配非首页
107
107
  setRewriteUriPromises.push(
108
108
  setRewriteUri(
109
109
  domain,
@@ -112,24 +112,8 @@ export default async (cmd: any) => {
112
112
  cdn
113
113
  )
114
114
  );
115
- setRewriteUriPromises.push(
116
- setRewriteUri(
117
- domain,
118
- `^(${webEntryPath})($|\\?|#|\\/\\?|\\/$)`,
119
- `/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
120
- cdn
121
- )
122
- );
123
115
  } else if (cicd.web_type === 'history'){
124
- //文件
125
- setRewriteUriPromises.push(
126
- setRewriteUri(
127
- domain,
128
- '^\\/([^?]*\\.[a-zA-Z0-9]+)($|\\?)',
129
- `/$1`,
130
- cdn
131
- )
132
- );
116
+ //spa/history匹配非首页
133
117
  setRewriteUriPromises.push(
134
118
  setRewriteUri(
135
119
  domain,
@@ -138,16 +122,17 @@ export default async (cmd: any) => {
138
122
  cdn
139
123
  )
140
124
  );
125
+ //spa/history匹配文件
141
126
  setRewriteUriPromises.push(
142
127
  setRewriteUri(
143
128
  domain,
144
- `^(${webEntryPath})($|\\?|#|\\/\\?|\\/$)`,
145
- `/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
129
+ '^\\/([^?]*\\.[a-zA-Z0-9]+)($|\\?)',
130
+ `/${endpoint.deployDir.replace(/\\/g, '/')}/$1`,
146
131
  cdn
147
132
  )
148
133
  );
149
- }else {
150
- //文件
134
+ }else if (cicd.web_type === 'hash') {
135
+ //hash模式匹配文件
151
136
  setRewriteUriPromises.push(
152
137
  setRewriteUri(
153
138
  domain,
@@ -156,15 +141,16 @@ export default async (cmd: any) => {
156
141
  cdn
157
142
  )
158
143
  );
159
- setRewriteUriPromises.push(
160
- setRewriteUri(
161
- domain,
162
- `^(${webEntryPath})($|\\?|#|\\/\\?|\\/$)`,
163
- `/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
164
- cdn
165
- )
166
- );
167
144
  }
145
+ //首页匹配正则,hash,history,mpa三个模式通用
146
+ setRewriteUriPromises.push(
147
+ setRewriteUri(
148
+ domain,
149
+ `^(${webEntryPath})($|\\?|#|\\/\\?|\\/$)`,
150
+ `/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
151
+ cdn
152
+ )
153
+ );
168
154
  urls.push(`https://${domain}${webEntryPath}`);
169
155
  }
170
156
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rigjs",
3
- "version": "2.1.20",
3
+ "version": "2.1.21",
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",