File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import type { ResourceMeta } from './types'
2
2
3
- const IS_JS_RE = / \. [ c m ] ? j s ( \? [ ^ . ] + ) ? $ /
3
+ const IS_JS_RE = / \. [ c m ] ? j s (?: \? [ ^ . ] + ) ? $ /
4
4
const HAS_EXT_RE = / [ ^ . / ] + \. [ ^ . / ] + $ /
5
- const IS_CSS_RE = / \. ( c s s | p o s t c s s | p c s s | s a s s | s c s s | l e s s | s t y l u s | s t y l ) ( \? [ ^ . ] + ) ? $ /
5
+ const IS_CSS_RE = / \. (?: c s s | p o s t c s s | p c s s | s a s s | s c s s | l e s s | s t y l u s | s t y l ) (?: \? [ ^ . ] + ) ? $ /
6
6
7
7
export function isJS ( file : string ) {
8
8
return IS_JS_RE . test ( file ) || ! HAS_EXT_RE . test ( file )
@@ -12,10 +12,10 @@ export function isCSS(file: string) {
12
12
return IS_CSS_RE . test ( file )
13
13
}
14
14
15
- const IMAGE_RE = / ^ j p e ? g | p n g | s v g | g i f | w e b p | i c o $ /
16
- const FONT_RE = / ^ w o f f 2 ? | t t f | o t f | e o t $ /
17
- const AUDIO_RE = / ^ m p 3 | w a v | o g g | f l a c | a a c | m 4 a | w m a | a i f f | a i f | a u | r a w | v o x | o p u s $ /
18
- const VIDEO_RE = / ^ m p 4 | w e b m | o g v | m k v | a v i | m o v | f l v | w m v | m p g | m p e g | m 4 v | 3 g p | 3 g 2 | m x f | r m | r m v b | a s f | a s x | m 3 u 8 | m 3 u | p l s | c u e | m 3 u 8 $ /
15
+ const IMAGE_RE = / ^ (?: j p e ? g | p n g | s v g | g i f | w e b p | i c o ) $ /
16
+ const FONT_RE = / ^ (?: w o f f 2 ? | t t f | o t f | e o t ) $ /
17
+ const AUDIO_RE = / ^ (?: m p 3 | w a v | o g g | f l a c | a a c | m 4 a | w m a | a i f f | a i f | a u | r a w | v o x | o p u s ) $ /
18
+ const VIDEO_RE = / ^ (?: m p 4 | w e b m | o g v | m k v | a v i | m o v | f l v | w m v | m p g | m p e g | m 4 v | 3 g p | 3 g 2 | m x f | r m | r m v b | a s f | a s x | m 3 u 8 | m 3 u | p l s | c u e ) $ /
19
19
20
20
const contentTypeMap : Record < string , string > = {
21
21
ico : 'image/x-icon' ,
You can’t perform that action at this time.
0 commit comments