Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
fix: use node_modules/.package-lock.json for npm install required not…
Browse files Browse the repository at this point in the history
…ifications, since this file gets touched every time a npm install is executed (even if the dependencies have not changed)
  • Loading branch information
pas-n committed Sep 29, 2022
1 parent a8ddcad commit e330dc0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ private boolean _isRequired()
FileObject packageJsonFo = project.getProjectDirectory().getFileObject("package.json");
if (packageJsonFo == null)
return false;
FileObject nodeModulesFo = project.getProjectDirectory().getFileObject("node_modules");
long nodeModulesLastModified = nodeModulesFo == null ? 0 : FileUtil.toFile(nodeModulesFo).lastModified();
FileObject packageLockFo = project.getProjectDirectory()
.getFileObject("node_modules", false)
.getFileObject(".package-lock.json");
long nodeModulesLastModified = packageLockFo == null ? 0 : FileUtil.toFile(packageLockFo).lastModified();
return nodeModulesLastModified < FileUtil.toFile(packageJsonFo).lastModified();
}

Expand Down

0 comments on commit e330dc0

Please sign in to comment.