Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export function resolve(
}

export async function load(url: string, context: { format?: string | null }, nextLoad: Function) {
if (isFileProtocol(url)) {
const { format } = context;

// CommonJs modules require no transformations and are not in memory.
if (format !== 'commonjs' && isFileProtocol(url)) {
const filePath = fileURLToPath(url);
// Remove '/' or drive letter for Windows that was added in the above 'resolve'.
let source = outputFiles[relative('/', filePath)] ?? TRANSFORMED_FILES[filePath];
Expand All @@ -81,8 +84,6 @@ export async function load(url: string, context: { format?: string | null }, nex
}

if (source !== undefined) {
const { format } = context;

return {
format,
shortCircuit: true,
Expand Down