mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-01 22:34:01 -04:00
!88 replace by absolute path
Merge pull request !88 from houhaoyu/abspath
This commit is contained in:
@@ -57,11 +57,11 @@ function loadEntryObj(projectPath, device_level, abilityType, manifestFilePath)
|
||||
if (!fs.existsSync(appJSPath)) {
|
||||
throw Error(red + 'ERROR: missing app.js' + reset).message;
|
||||
}
|
||||
entryObj['./app'] = projectPath + '/app.js?entry';
|
||||
entryObj['./app'] = path.resolve(projectPath, './app.js?entry');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
entryObj[`./${abilityType}`] = projectPath + `/${abilityType}.js?entry`;
|
||||
entryObj[`./${abilityType}`] = path.resolve(projectPath + `./${abilityType}.js?entry`);
|
||||
break
|
||||
}
|
||||
return entryObj;
|
||||
@@ -83,9 +83,9 @@ function addPageEntryObj(manifest, projectPath) {
|
||||
if (isHml && isVisual) {
|
||||
throw Error(red + 'ERROR: ' + sourcePath + ' cannot both have hml && visual').message;
|
||||
} else if (isHml) {
|
||||
entryObj['./' + element] = hmlPath + '?entry';
|
||||
entryObj['./' + element] = path.resolve(projectPath, './' + sourcePath + '.hml?entry');
|
||||
} else if (isVisual) {
|
||||
entryObj['./' + element] = visualPath + '?entry';
|
||||
entryObj['./' + element] = path.resolve(aceSuperVisualPath, './' + sourcePath + '.visual?entry');
|
||||
}
|
||||
})
|
||||
return entryObj;
|
||||
|
||||
@@ -162,14 +162,15 @@ function addPageEntryObj() {
|
||||
const visualPath = path.join(aceSuperVisualPath, sourcePath + '.visual');
|
||||
const isHml = fs.existsSync(hmlPath);
|
||||
const isVisual = fs.existsSync(visualPath);
|
||||
const projectPath = process.env.projectPath;
|
||||
if (isHml && isVisual) {
|
||||
logWarn(this, [{
|
||||
reason: 'ERROR: ' + sourcePath + ' cannot both have hml && visual',
|
||||
}]);
|
||||
} else if (isHml) {
|
||||
entryObj['./' + element] = hmlPath + '?entry';
|
||||
entryObj['./' + element] = path.resolve(projectPath, './' + sourcePath + '.hml?entry');
|
||||
} else if (isVisual) {
|
||||
entryObj['./' + element] = visualPath + '?entry';
|
||||
entryObj['./' + element] = path.resolve(aceSuperVisualPath, './' + sourcePath + '.visual?entry');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user