Skip to content

Commit

Permalink
Using url for import including "file" protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Desmaisons committed Aug 17, 2021
1 parent 5a5a574 commit e90a2e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/import-or-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function importOrRequire(file) {
const ext = extnamePath(file);

if (ext === '.mjs' || (ext === '.js' && getPackageType.sync(file) === 'module')) {
return import(file);
return import("file://" + file);
}
require(file);
};

0 comments on commit e90a2e2

Please sign in to comment.