We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d55f4d commit 5ebe828Copy full SHA for 5ebe828
src/utils.ts
@@ -1,11 +1,15 @@
1
import { Resource } from './renderer'
2
3
+const IS_JS_RE = /\.[cm]?js(\?[^.]+)?$/
4
+const HAS_EXT_RE = /[^./]+\.[^./]+$/
5
+const IS_CSS_RE = /\.css(\?[^.]+)?$/
6
+
7
export function isJS (file: string) {
- return /\.[cm]?js(\?[^.]+)?$/.test(file)
8
+ return IS_JS_RE.test(file) || !HAS_EXT_RE.test(file)
9
}
10
11
export function isCSS (file: string) {
- return /\.css(\?[^.]+)?$/.test(file)
12
+ return IS_CSS_RE.test(file)
13
14
15
export function normalizeFile (file: string): Resource {
0 commit comments