-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: filter files using Vite's recommended mode #1
- Loading branch information
1 parent
820ee17
commit aeaafd1
Showing
2 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,45 @@ | ||
export const DEFAULT_EXTENSIONS = [ | ||
'.jpg', | ||
'.jpeg', | ||
'.png', | ||
'.apng', | ||
'.gif', | ||
'.bmp', | ||
'.svg', | ||
'.webp', | ||
// ** READ THIS ** before editing `KNOWN_ASSET_TYPES`. | ||
// If you add an asset to `KNOWN_ASSET_TYPES`, make sure to also add it | ||
// to the TypeScript declaration file `packages/vite/client.d.ts` and | ||
// add a mime type to the `registerCustomMime` in | ||
// `packages/vite/src/node/plugin/assets.ts` if mime type cannot be | ||
// looked up by mrmime. | ||
export const KNOWN_ASSET_TYPES = [ | ||
// images | ||
'apng', | ||
'png', | ||
'jpe?g', | ||
'jfif', | ||
'pjpeg', | ||
'pjp', | ||
'gif', | ||
'svg', | ||
'ico', | ||
'webp', | ||
'avif', | ||
|
||
// media | ||
'mp4', | ||
'webm', | ||
'ogg', | ||
'mp3', | ||
'wav', | ||
'flac', | ||
'aac', | ||
'opus', | ||
|
||
// fonts | ||
'woff2?', | ||
'eot', | ||
'ttf', | ||
'otf', | ||
|
||
// other | ||
'webmanifest', | ||
'pdf', | ||
'txt', | ||
] | ||
|
||
export const DEFAULT_ASSETS_RE = new RegExp( | ||
`\\.(${KNOWN_ASSET_TYPES.join('|')})(\\?.*)?$`, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters