Skip to content

Commit

Permalink
fix(url-loader): suppress dynamic import warnings from bundlers
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Apr 6, 2023
1 parent e41513a commit 58414b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-pets-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/url-loader': patch
---

Suppress dynamic import warnings from webpack
4 changes: 2 additions & 2 deletions packages/loaders/url/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export { FetchFn };
export type AsyncImportFn = (moduleName: string) => PromiseLike<any>;
export type SyncImportFn = (moduleName: string) => any;

const asyncImport: AsyncImportFn = (moduleName: string) => import(moduleName);
const syncImport: SyncImportFn = (moduleName: string) => require(moduleName);
const asyncImport: AsyncImportFn = (moduleName: string) => import(`${moduleName}`);
const syncImport: SyncImportFn = (moduleName: string) => require(`${moduleName}`);

type HeadersConfig = Record<string, string>;

Expand Down

0 comments on commit 58414b2

Please sign in to comment.