Skip to content

Commit

Permalink
feat(remix-dev): import .gql & .graphql files as text
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Aug 11, 2022
1 parent ec78b00 commit d07c1df
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-poets-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": minor
---

feat(remix-dev): import `.gql` & `.graphql` files as text
2 changes: 2 additions & 0 deletions packages/remix-dev/compiler/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const loaders: { [ext: string]: esbuild.Loader } = {
".eot": "file",
".flac": "file",
".gif": "file",
".gql": "text",
".graphql": "text",
".ico": "file",
".jpeg": "file",
".jpg": "file",
Expand Down
12 changes: 12 additions & 0 deletions packages/remix-dev/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ declare module "*.gif" {
let asset: string;
export default asset;
}
declare module "*.gql" {
let asset: string;
export default asset;
}
declare module "*.graphql" {
let asset: string;
export default asset;
}
declare module "*.jpeg" {
let asset: string;
export default asset;
Expand Down Expand Up @@ -60,6 +68,10 @@ declare module "*.png" {
let asset: string;
export default asset;
}
declare module "*.sql" {
let asset: string;
export default asset;
}
declare module "*.svg" {
let asset: string;
export default asset;
Expand Down

0 comments on commit d07c1df

Please sign in to comment.