diff --git a/.gitpod.yml b/.gitpod.yml index 74e3b8d..8474cdc 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -7,4 +7,4 @@ tasks: - init: npm install && npm run build - +image: gitpod/workspace-node:latest diff --git a/src/index.ts b/src/index.ts index 16a199e..859f47a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 + }); if (format === 'module') { const sourceFilePath = fileURLToPath(url);