mirror of
https://gitee.com/openharmony/developtools_ace_js2bundle
synced 2024-11-26 17:10:58 +00:00
commit
9b2eeee914
@ -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
|
||||
};
|
@ -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')
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user