Skip to content

Commit

Permalink
fix: keep compatibility with egg-bin v6
Browse files Browse the repository at this point in the history
closes #38
  • Loading branch information
fengmk2 committed Jan 8, 2025
1 parent 9326f75 commit 00f2db3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async function findEggCore(options: LoaderOptions): Promise<{ EggCore?: object;
const baseDirRealpath = await realpath(options.baseDir);
const frameworkRealpath = await realpath(options.framework);
const paths = [ frameworkRealpath, baseDirRealpath ];
// custom framework => egg => @eggjs/core
// custom framework => egg => egg-core
try {
const { EggCore, EggLoader } = await importModule('egg', { paths });
if (EggLoader) {
Expand All @@ -133,7 +133,7 @@ async function findEggCore(options: LoaderOptions): Promise<{ EggCore?: object;
debug('[findEggCore] import "egg" from paths:%o error: %o', paths, err);
}

const name = '@eggjs/core';
const name = 'egg-core';
// egg => egg-core
try {
const { EggCore, EggLoader } = await importModule(name, { paths });
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/egg-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "egg-app",
"dependencies": {
"egg": "beta",
"@eggjs/core": "6",
"egg": "3",
"egg-core": "5",
"framework-demo": "^1.0.1"
}
}

0 comments on commit 00f2db3

Please sign in to comment.