Skip to content

Commit

Permalink
Merge pull request #12929 from guybedford/imports-test
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 19, 2021
2 parents 753720c + 09faac2 commit f4ae05e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/NormalModuleFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class NormalModuleFactory extends ModuleFactory {
}

// resource without scheme and without path
else if (/^($|\?|#)/.test(unresolvedResource)) {
else if (/^($|\?)/.test(unresolvedResource)) {
resourceData = {
resource: unresolvedResource,
data: {},
Expand Down
6 changes: 6 additions & 0 deletions test/cases/entry-exports-field/imports/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import d1 from "./pkg.mjs";
import d2 from "#internal";

it("imports field to resolve to the same", () => {
expect(d1).toBe(d2);
});
7 changes: 7 additions & 0 deletions test/cases/entry-exports-field/imports/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg",
"exports": "./pkg.mjs",
"imports": {
"#internal": "./pkg.mjs"
}
}
1 change: 1 addition & 0 deletions test/cases/entry-exports-field/imports/pkg.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'pkg';

0 comments on commit f4ae05e

Please sign in to comment.