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

feat(alias)!: resolve entry id #1402

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions packages/alias/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ export default function alias(options: RollupAliasOptions = {}): Plugin {
);
},
resolveId(importee, importer, resolveOptions) {
if (!importer) {
return null;
}
// First match is supposed to be the correct one
const matchedEntry = entries.find((entry) => matches(entry.find, importee));
if (!matchedEntry) {
Expand Down
4 changes: 2 additions & 2 deletions packages/alias/test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ test('Will not confuse modules with similar names', (t) =>
]
).then((result) => t.deepEqual(result, [null, null, null])));

test('Leaves entry file untouched if matches alias', (t) =>
test('Alias entry file', (t) =>
resolveAliasWithRollup(
{
entries: [{ find: 'abacaxi', replacement: './abacaxi' }]
},
// eslint-disable-next-line no-undefined
[{ source: 'abacaxi/entry.js' }]
).then((result) => t.deepEqual(result, [null])));
).then((result) => t.deepEqual(result, ['./abacaxi/entry.js'])));

test('i/am/a/file', (t) =>
resolveAliasWithRollup(
Expand Down