Skip to content

Commit

Permalink
feat: image type add bmp (#5921)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Jun 19, 2024
1 parent f33dabb commit 98f9b7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/vite-node/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const KNOWN_ASSET_TYPES = [
// images
'apng',
'bmp',
'png',
'jpe?g',
'jfif',
Expand Down
4 changes: 2 additions & 2 deletions packages/vite-node/src/externalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync, promises as fsp } from 'node:fs'
import { dirname, extname, join } from 'pathe'
import type { DepsHandlingOptions } from './types'
import { findNearestPackageData, isNodeBuiltin, slash } from './utils'
import { KNOWN_ASSET_TYPES } from './constants'
import { KNOWN_ASSET_RE } from './constants'

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

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

const depsExternal = [
Expand Down

0 comments on commit 98f9b7a

Please sign in to comment.