mirror of
https://github.com/pysunday/sdenv.git
synced 2025-04-12 03:37:16 +08:00
fix: 编辑器中直接运行example文件报错修复
This commit is contained in:
parent
30f78974e9
commit
cdb4d2a0ef
@ -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;
|
||||
@ -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'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user