mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-18 16:04:32 -04:00
watch package.json Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: I346107f11d77fe80f4fda26a55c2930cc37eddba
This commit is contained in:
@@ -128,11 +128,29 @@ function initConfig(config) {
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../../../../node_modules'));
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../../../../../node_modules'));
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../../'));
|
||||
existsPackageJson(config, path.resolve(projectPath, '../../../../../package.json'),
|
||||
path.resolve(projectPath, '../../../../package.json'));
|
||||
} else {
|
||||
config.resolve.modules.push(path.join(projectPath, '../../../../'));
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../../../node_modules'));
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../../../../node_modules'));
|
||||
config.resolve.modules.push(path.resolve(projectPath, '../'));
|
||||
existsPackageJson(config, path.resolve(projectPath, '../../../../package.json'),
|
||||
path.resolve(projectPath, '../../../package.json'));
|
||||
}
|
||||
}
|
||||
|
||||
function existsPackageJson(config, rootPackageJsonPath, modulePackageJsonPath) {
|
||||
if (config.cache) {
|
||||
config.cache.buildDependencies = {
|
||||
config: []
|
||||
};
|
||||
if (fs.existsSync(rootPackageJsonPath)) {
|
||||
config.cache.buildDependencies.config.push(rootPackageJsonPath);
|
||||
}
|
||||
if (fs.existsSync(modulePackageJsonPath)) {
|
||||
config.cache.buildDependencies.config.push(modulePackageJsonPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user