Comparing version 4.0.0 to 4.0.1
@@ -21,3 +21,16 @@ const path = require('path'); | ||
mod => mod.default, | ||
e => Promise.reject(fixupImportException(e, modulePath)) | ||
e => { | ||
if (e.code === 'ERR_UNKNOWN_FILE_EXTENSION') { | ||
// Extension isn't supported by import, e.g. .jsx. Fall back to | ||
// require(). This could lead to confusing error messages if someone | ||
// tries to use ES module syntax without transpiling in a file with | ||
// an unsupported extension, but it shouldn't break anything and it | ||
// should work well in the normal case where the file is loadable | ||
// as a CommonJS module, either directly or with the help of a | ||
// loader like `@babel/register`. | ||
return this.require_(modulePath); | ||
} else { | ||
return Promise.reject(fixupImportException(e, modulePath)); | ||
} | ||
} | ||
); | ||
@@ -24,0 +37,0 @@ } else { |
@@ -13,3 +13,3 @@ { | ||
"license": "MIT", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"repository": { | ||
@@ -16,0 +16,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44676
1166