diff --git a/packages/pkg/CHANGELOG.md b/packages/pkg/CHANGELOG.md index 6d1583d2..86977589 100644 --- a/packages/pkg/CHANGELOG.md +++ b/packages/pkg/CHANGELOG.md @@ -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 diff --git a/packages/pkg/package.json b/packages/pkg/package.json index ea757c10..625fd76e 100644 --- a/packages/pkg/package.json +++ b/packages/pkg/package.json @@ -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", diff --git a/packages/pkg/src/rollupPlugins/alias.ts b/packages/pkg/src/rollupPlugins/alias.ts index 9d8812f7..d550aff0 100644 --- a/packages/pkg/src/rollupPlugins/alias.ts +++ b/packages/pkg/src/rollupPlugins/alias.ts @@ -53,6 +53,10 @@ const aliasPlugin = (rootDir: string, originalAlias: Record): 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; }