!345 js debug line error

Merge pull request !345 from 卡哥/master
This commit is contained in:
openharmony_ci 2022-08-16 11:11:18 +00:00 committed by Gitee
commit 9b2eeee914
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 4 deletions

View File

@ -216,6 +216,14 @@ function compareCache(cachePath) {
}
}
function parseAbilityName(abilityType, projectPath) {
if (abilityType === 'page') {
return path.resolve(__dirname, projectPath, 'app.js');
} else {
return path.resolve(__dirname, projectPath, abilityType + '.js');
}
}
module.exports = {
deleteFolderRecursive: deleteFolderRecursive,
readManifest: readManifest,
@ -226,5 +234,6 @@ module.exports = {
multiResourceBuild: multiResourceBuild,
readWorkerFile: readWorkerFile,
compareCache: compareCache,
systemModules: systemModules
systemModules: systemModules,
parseAbilityName: parseAbilityName
};

View File

@ -35,7 +35,8 @@ const {
hashProjectPath,
checkMultiResourceBuild,
readWorkerFile,
compareCache
compareCache,
parseAbilityName
} = require('./main.product')
const richModule = {
@ -376,8 +377,7 @@ module.exports = (env) => {
})
} else {
config.module.rules.unshift({
test: new RegExp("(" + (process.env.abilityType === 'page' ?
'app' : process.env.abilityType) + "\.js)(\\?[^?]+)?$"),
test: parseAbilityName(process.env.abilityType, process.env.projectPath),
use: [{
loader: path.resolve(__dirname, './index.js')
}]