rigjs 2.1.24 → 2.1.25
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 +62 -62
- package/lib/publish/index.ts +30 -10
- package/package.json +1 -1
package/lib/publish/index.ts
CHANGED
|
@@ -103,6 +103,15 @@ export default async (cmd: any) => {
|
|
|
103
103
|
cdn
|
|
104
104
|
)
|
|
105
105
|
);
|
|
106
|
+
//mpa匹配文件
|
|
107
|
+
setRewriteUriPromises.push(
|
|
108
|
+
setRewriteUri(
|
|
109
|
+
domain,
|
|
110
|
+
`^\\/([^?]*\\.[a-zA-Z0-9]+)($|\\?)`,
|
|
111
|
+
`/${endpoint.deployDir.replace(/\\/g, '/')}/$1`,
|
|
112
|
+
cdn
|
|
113
|
+
)
|
|
114
|
+
);
|
|
106
115
|
} else if (cicd.web_type === 'history') {
|
|
107
116
|
//spa/history匹配非首页
|
|
108
117
|
setRewriteUriPromises.push(
|
|
@@ -113,17 +122,28 @@ export default async (cmd: any) => {
|
|
|
113
122
|
cdn
|
|
114
123
|
)
|
|
115
124
|
);
|
|
125
|
+
//spa-history匹配文件
|
|
126
|
+
setRewriteUriPromises.push(
|
|
127
|
+
setRewriteUri(
|
|
128
|
+
domain,
|
|
129
|
+
`^\\/([^?]*\\.[a-zA-Z0-9]+)($|\\?)`,
|
|
130
|
+
`/${endpoint.deployDir.replace(/\\/g, '/')}/$1`,
|
|
131
|
+
cdn
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
}else{
|
|
135
|
+
//spa-hash匹配文件
|
|
136
|
+
//hash模式支持一个域名支持多个网页应用的入口路径,如/,/app1,/app2,都是不同的网页应用
|
|
137
|
+
//需要替换webpack中的publicPath为实际OSS的目录
|
|
138
|
+
setRewriteUriPromises.push(
|
|
139
|
+
setRewriteUri(
|
|
140
|
+
domain,
|
|
141
|
+
`^\\/([^?]*\\.[a-zA-Z0-9]+)($|\\?)`,
|
|
142
|
+
`/$1`,
|
|
143
|
+
cdn
|
|
144
|
+
)
|
|
145
|
+
);
|
|
116
146
|
}
|
|
117
|
-
//匹配文件,3个模式通用
|
|
118
|
-
const divide = webEntryPath === '/' ? '' : '/';
|
|
119
|
-
setRewriteUriPromises.push(
|
|
120
|
-
setRewriteUri(
|
|
121
|
-
domain,
|
|
122
|
-
`^${webEntryPath}${divide}([^?]*\\.[a-zA-Z0-9]+)($|\\?)`,
|
|
123
|
-
`/${endpoint.deployDir.replace(/\\/g, '/')}/$1`,
|
|
124
|
-
cdn
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
147
|
//首页匹配正则,hash,history,mpa三个模式通用
|
|
128
148
|
setRewriteUriPromises.push(
|
|
129
149
|
setRewriteUri(
|
package/package.json
CHANGED