Skip to content

Commit

Permalink
feat: 🎸 rollupPlugins alias fix empty importee (#643)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored May 10, 2024
1 parent ed98f31 commit 2dadeab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/pkg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.5.21

### Patch Changes

- b3e745d: fix: fail to resolve alias when `import.meta` in the code

## 1.5.20

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pkg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/pkg",
"version": "1.5.20",
"version": "1.5.21",
"description": "A fast builder for React components, Node modules and web libraries.",
"type": "module",
"main": "./lib/index.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/pkg/src/rollupPlugins/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const aliasPlugin = (rootDir: string, originalAlias: Record<string, string>): Pl
};

export function matches(pattern: string, importee: string) {
// empty importee or pattern just return false
if (!importee || !pattern) {
return false;
}
if (importee.length < pattern.length) {
return false;
}
Expand Down

0 comments on commit 2dadeab

Please sign in to comment.