mirror of
https://github.com/pysunday/sdenv.git
synced 2025-04-19 03:44:43 +08:00
fix: 编辑器中直接运行example文件报错修复
This commit is contained in:
parent
30f78974e9
commit
cdb4d2a0ef
@ -3,7 +3,7 @@ const fs = require('fs');
|
|||||||
|
|
||||||
const appDirectory = (() => {
|
const appDirectory = (() => {
|
||||||
// 返回项目根目录
|
// 返回项目根目录
|
||||||
const plist = fs.realpathSync(process.cwd()).split('/');
|
const plist = fs.realpathSync(__dirname).split('/');
|
||||||
while (!fs.existsSync(path.resolve(plist.join('/'), 'package.json'))) {
|
while (!fs.existsSync(path.resolve(plist.join('/'), 'package.json'))) {
|
||||||
plist.pop();
|
plist.pop();
|
||||||
if (plist.length === 0) return false;
|
if (plist.length === 0) return false;
|
||||||
@ -17,7 +17,7 @@ module.exports = {
|
|||||||
homePath: __dirname,
|
homePath: __dirname,
|
||||||
modulePath: resolveApp('node_modules'),
|
modulePath: resolveApp('node_modules'),
|
||||||
binPath: resolveApp('node_modules/.bin/'),
|
binPath: resolveApp('node_modules/.bin/'),
|
||||||
package: path.resolve('package.json'),
|
package: resolveApp('package.json'),
|
||||||
resolve: resolveApp,
|
resolve: resolveApp,
|
||||||
handlerPath: resolveApp('handler'),
|
handlerPath: resolveApp('handler'),
|
||||||
configPath: resolveApp('config'),
|
configPath: resolveApp('config'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user