Skip to content

Commit 98f9b7a

Browse files
authored
feat: image type add bmp (#5921)
1 parent f33dabb commit 98f9b7a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/vite-node/src/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const KNOWN_ASSET_TYPES = [
22
// images
33
'apng',
4+
'bmp',
45
'png',
56
'jpe?g',
67
'jfif',

packages/vite-node/src/externalize.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { existsSync, promises as fsp } from 'node:fs'
22
import { dirname, extname, join } from 'pathe'
33
import type { DepsHandlingOptions } from './types'
44
import { findNearestPackageData, isNodeBuiltin, slash } from './utils'
5-
import { KNOWN_ASSET_TYPES } from './constants'
5+
import { KNOWN_ASSET_RE } from './constants'
66

77
const BUILTIN_EXTENSIONS = new Set(['.mjs', '.cjs', '.node', '.wasm'])
88

@@ -18,7 +18,7 @@ const defaultInline = [
1818
// special Vite query strings
1919
/[?&](init|raw|url|inline)\b/,
2020
// Vite returns a string for assets imports, even if it's inside "node_modules"
21-
new RegExp(`\\.(${KNOWN_ASSET_TYPES.join('|')})$`),
21+
KNOWN_ASSET_RE,
2222
]
2323

2424
const depsExternal = [

0 commit comments

Comments
 (0)