Skip to content

Commit

Permalink
feat: add .txt file format to assets (#6265)
Browse files Browse the repository at this point in the history
  • Loading branch information
boehs committed Jan 16, 2022
1 parent 870e1c0 commit e87ae41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/vite/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ declare module '*.pdf' {
const src: string
export default src
}
declare module '*.txt' {
const src: string
export default src
}

// web worker
declare module '*?worker' {
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/node/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export const KNOWN_ASSET_TYPES = [
// other
'wasm',
'webmanifest',
'pdf'
'pdf',
'txt'
]

export const DEFAULT_ASSETS_RE = new RegExp(
Expand Down

0 comments on commit e87ae41

Please sign in to comment.