Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Jan Olaf Krems <[email protected]>
  • Loading branch information
guybedford and hybrist committed Jul 4, 2020
commit 105b7f2b033c4ba6062cfbf96c8386de7ea3b3e6
1 change: 1 addition & 0 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ Module._load = function(request, parent, isMain) {
return module.exports;
};

// TODO: Use this set when resolving pkg#exports conditions.
const cjsConditions = new Set(['require', 'node']);
Module._resolveFilename = function(request, parent, isMain, options) {
if (NativeModule.canBeRequiredByUsers(request)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function getPackageConfig(path) {
name,
type,
exports,
imports
imports,
};
packageJSONCache.set(path, packageConfig);
return packageConfig;
Expand Down Expand Up @@ -156,7 +156,7 @@ function getPackageScopeConfig(resolved, base) {
name: undefined,
type: 'none',
exports: undefined,
imports: undefined
imports: undefined,
};
packageJSONCache.set(packageJSONPath, packageConfig);
return packageConfig;
Expand Down
1 change: 0 additions & 1 deletion test/es-module/test-esm-exports.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js';

// The use of %2F escapes in paths fails loading
loadFixture('pkgexports/sub/..%2F..%2Fbar.js').catch(mustCall((err) => {
console.log(err);
strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER');
}));

Expand Down