File tree 2 files changed +4
-0
lines changed
2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ export function transformMiddleware(
175
175
}
176
176
177
177
if (
178
+ req . headers [ 'sec-fetch-dest' ] === 'script' ||
178
179
isJSRequest ( url ) ||
179
180
isImportRequest ( url ) ||
180
181
isCSSRequest ( url ) ||
Original file line number Diff line number Diff line change @@ -271,6 +271,9 @@ export const isDataUrl = (url: string): boolean => dataUrlRE.test(url)
271
271
export const virtualModuleRE = / ^ v i r t u a l - m o d u l e : .* /
272
272
export const virtualModulePrefix = 'virtual-module:'
273
273
274
+ // NOTE: We should start relying on the "Sec-Fetch-Dest" header instead of this
275
+ // hardcoded list. We can eventually remove this function when the minimum version
276
+ // of browsers we support in dev all support this header.
274
277
const knownJsSrcRE =
275
278
/ \. (?: [ j t ] s x ? | m [ j t ] s | v u e | m a r k o | s v e l t e | a s t r o | i m b a | m d x ) (?: $ | \? ) /
276
279
export const isJSRequest = ( url : string ) : boolean => {
You can’t perform that action at this time.
0 commit comments