Skip to content

Commit

Permalink
fix node12
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed May 15, 2022
1 parent e54686c commit 6f3fdd7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dist-raw/node-internal-modules-cjs-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,15 @@ const Module_resolveFilename = function _resolveFilename(request, parent, isMain
paths = Module._resolveLookupPaths(request, parent);
}

if (parent?.filename) {
// if (parent?.filename) {
// node 12 hack
if (parent != null && parent.filename) {
if (request[0] === '#') {
const pkg = readPackageScope(parent.filename) || {};
if (pkg.data?.imports != null) {

// if (pkg.data?.imports != null) {
// node 12 hack
if (pkg.data != null && pkg.data.imports != null) {
try {
return finalizeEsmResolution(
packageImportsResolve(request, pathToFileURL(parent.filename),
Expand Down

0 comments on commit 6f3fdd7

Please sign in to comment.