Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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