Skip to content

Commit

Permalink
fix: 编辑器中直接运行example文件报错修复
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenxianluo committed Mar 28, 2024
1 parent 30f7897 commit cdb4d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs');

const appDirectory = (() => {
// 返回项目根目录
const plist = fs.realpathSync(process.cwd()).split('/');
const plist = fs.realpathSync(__dirname).split('/');
while (!fs.existsSync(path.resolve(plist.join('/'), 'package.json'))) {
plist.pop();
if (plist.length === 0) return false;
Expand All @@ -17,7 +17,7 @@ module.exports = {
homePath: __dirname,
modulePath: resolveApp('node_modules'),
binPath: resolveApp('node_modules/.bin/'),
package: path.resolve('package.json'),
package: resolveApp('package.json'),
resolve: resolveApp,
handlerPath: resolveApp('handler'),
configPath: resolveApp('config'),
Expand Down

0 comments on commit cdb4d2a

Please sign in to comment.