Skip to content

Commit 2dadeab

Browse files
excaliburhanrantang.hjpluhc228
authored
feat: 🎸 rollupPlugins alias fix empty importee (#643)
* feat: 🎸 rollupPlugins alias fix empty importee * chore: changeset * chore: version and changelog --------- Co-authored-by: rantang.hjp <[email protected]> Co-authored-by: luhc228 <[email protected]>
1 parent ed98f31 commit 2dadeab

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

‎packages/pkg/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.5.21
4+
5+
### Patch Changes
6+
7+
- b3e745d: fix: fail to resolve alias when `import.meta` in the code
8+
39
## 1.5.20
410

511
### Patch Changes

‎packages/pkg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ice/pkg",
3-
"version": "1.5.20",
3+
"version": "1.5.21",
44
"description": "A fast builder for React components, Node modules and web libraries.",
55
"type": "module",
66
"main": "./lib/index.js",

‎packages/pkg/src/rollupPlugins/alias.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ const aliasPlugin = (rootDir: string, originalAlias: Record<string, string>): Pl
5353
};
5454

5555
export function matches(pattern: string, importee: string) {
56+
// empty importee or pattern just return false
57+
if (!importee || !pattern) {
58+
return false;
59+
}
5660
if (importee.length < pattern.length) {
5761
return false;
5862
}

0 commit comments

Comments
 (0)