Skip to content

Commit

Permalink
fix: A few tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EntraptaJ committed Sep 9, 2023
1 parent 389281f commit d2ef72a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
tasks:
- init: npm install && npm run build


image: gitpod/workspace-node:latest
10 changes: 8 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,17 @@ export async function load(
const resolvedUrl = new URL(url);
const fileName = basename(resolvedUrl.pathname);

let format = 'commonjs';
/**
* TODO Massively refactor this and figure out WTF is happening
*/
let format = context.format ?? 'module';

if (extensionsRegex.test(fileName)) format = 'module';

const response = await nextLoad(url, context);
const response = await nextLoad(url, {
...context,
format

Check failure on line 277 in src/index.ts

View workflow job for this annotation

GitHub Actions / ESLint (15.x)

Insert `,`
});

if (format === 'module') {
const sourceFilePath = fileURLToPath(url);
Expand Down

0 comments on commit d2ef72a

Please sign in to comment.