Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support wildcards pattern with common suffix in imports/exports field #353

Merged
merged 13 commits into from Apr 19, 2023
335 changes: 130 additions & 205 deletions lib/util/entrypoints.js

Large diffs are not rendered by default.

459 changes: 459 additions & 0 deletions test/exportsField.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions test/fixtures/imports-exports-wildcard/node_modules/m/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
13 changes: 13 additions & 0 deletions test/importsField.js
Expand Up @@ -1357,4 +1357,17 @@ describe("ImportsFieldPlugin", () => {
}
);
});

it("should resolve with wildcard pattern", done => {
const fixture = path.resolve(
__dirname,
"./fixtures/imports-exports-wildcard/node_modules/m/"
);
resolver.resolve({}, fixture, "#internal/i.js", {}, (err, result) => {
if (err) return done(err);
if (!result) throw new Error("No result");
result.should.equal(path.resolve(fixture, "./src/internal/i.js"));
done();
});
});
});