Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed May 4, 2024
2 parents 27afcdb + 28e1a37 commit 6e3d7a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-schools-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@farmfe/core': patch
---

fix(vite plugin): some vite plugins do not provide `alias` configuration errors
2 changes: 1 addition & 1 deletion packages/core/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export async function resolveConfig(
resolvedUserConfig.rustPlugins = rustPlugins;

// Temporarily dealing with alias objects and arrays in js will be unified in rust in the future.]
if (resolvedUserConfig.compilation.resolve?.alias && vitePlugins.length) {
if (vitePlugins.length) {
resolvedUserConfig.compilation.resolve.alias = getAliasEntries(
resolvedUserConfig.compilation.resolve.alias
);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/plugin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function throwError(pluginName: string, type: string, error: Error) {
export function getAliasEntries(
entries: Record<string, string> | Array<Alias>
): any {
if (!entries) {
if (!entries || !Object.keys(entries).length) {
return [];
}

Expand Down

0 comments on commit 6e3d7a3

Please sign in to comment.