Skip to content

Commit

Permalink
feat: add more asset import file extensions (#5030)
Browse files Browse the repository at this point in the history
* Add file extensions to compiler/loaders

* Create bright-moons-attend.md
  • Loading branch information
staylor authored Jan 11, 2023
1 parent fd7e46d commit 3eeb9be
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-moons-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": minor
---

Specify "file" as loader for .fbx, .glb, .gltf, .hdr, and .mov files.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
- sndrem
- sobrinho
- squidpunch
- staylor
- stephanerangaya
- SufianBabri
- supachaidev
Expand Down
5 changes: 5 additions & 0 deletions packages/remix-dev/compiler/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ export const loaders: { [ext: string]: esbuild.Loader } = {
".avif": "file",
".css": "file",
".eot": "file",
".fbx": "file",
".flac": "file",
".gif": "file",
".glb": "file",
".gltf": "file",
".gql": "text",
".graphql": "text",
".hdr": "file",
".ico": "file",
".jpeg": "file",
".jpg": "file",
Expand All @@ -20,6 +24,7 @@ export const loaders: { [ext: string]: esbuild.Loader } = {
// the JSX for esbuild to handle
".md": "jsx",
".mdx": "jsx",
".mov": "file",
".mp3": "file",
".mp4": "file",
".ogg": "file",
Expand Down
20 changes: 20 additions & 0 deletions packages/remix-dev/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ declare module "*.eot" {
let asset: string;
export default asset;
}
declare module "*.fbx" {
let asset: string;
export default asset;
}
declare module "*.flac" {
let asset: string;
export default asset;
Expand All @@ -26,6 +30,14 @@ declare module "*.gif" {
let asset: string;
export default asset;
}
declare module "*.glb" {
let asset: string;
export default asset;
}
declare module "*.gltf" {
let asset: string;
export default asset;
}
declare module "*.gql" {
let asset: string;
export default asset;
Expand All @@ -34,6 +46,10 @@ declare module "*.graphql" {
let asset: string;
export default asset;
}
declare module "*.hdr" {
let asset: string;
export default asset;
}
declare module "*.jpeg" {
let asset: string;
export default asset;
Expand All @@ -60,6 +76,10 @@ declare module "*.mp3" {
let asset: string;
export default asset;
}
declare module "*.mov" {
let asset: string;
export default asset;
}
declare module "*.mp4" {
let asset: string;
export default asset;
Expand Down

0 comments on commit 3eeb9be

Please sign in to comment.