File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -225,9 +225,12 @@ exports.run = function (options) {
225
225
}
226
226
227
227
// 判断所请求的资源是否在入口配置中
228
- if ( sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrl ) ) {
228
+ var matchingPath = sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrl ) ;
229
+ var matchingPathWithoutVer = sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrlNoVer ) ;
230
+ var matchingKeyWithoutVer = sysPath . normalize ( requestUrlNoVer ) === entryKey + sysPath . extname ( requestUrl ) ;
231
+ if ( matchingPath ) {
229
232
isRequestingEntry = true ;
230
- } else if ( sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrlNoVer ) ) {
233
+ } else if ( matchingPathWithoutVer || matchingKeyWithoutVer ) {
231
234
req . url = req . url . replace ( rversion , '' ) ;
232
235
isRequestingEntry = true ;
233
236
}
Original file line number Diff line number Diff line change @@ -218,9 +218,12 @@ exports.run = (options) => {
218
218
}
219
219
220
220
// 判断所请求的资源是否在入口配置中
221
- if ( sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrl ) ) {
221
+ const matchingPath = sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrl ) ;
222
+ const matchingPathWithoutVer = sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrlNoVer ) ;
223
+ const matchingKeyWithoutVer = sysPath . normalize ( requestUrlNoVer ) === entryKey + sysPath . extname ( requestUrl ) ;
224
+ if ( matchingPath ) {
222
225
isRequestingEntry = true ;
223
- } else if ( sysPath . normalize ( entryPath ) === sysPath . normalize ( requestUrlNoVer ) ) {
226
+ } else if ( matchingPathWithoutVer || matchingKeyWithoutVer ) {
224
227
req . url = req . url . replace ( rversion , '' ) ;
225
228
isRequestingEntry = true ;
226
229
}
You can’t perform that action at this time.
0 commit comments