Skip to content

Commit

Permalink
Don't call transform on file urls
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jul 15, 2022
1 parent 023f548 commit db35f22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/nodejs/esm-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ function dealWithExports(module) {
exports.loadFilesAsync = async (files, preLoadFunc, postLoadFunc) => {
for (const file of files) {
preLoadFunc(file);
const result = await exports.requireOrImport(path.resolve(file));
const filePath = file.startsWith('file://')
? file
: path.resolve(file)
const result = await exports.requireOrImport(filePath);
postLoadFunc(file, result);
}
};

0 comments on commit db35f22

Please sign in to comment.