summaryrefslogtreecommitdiff
path: root/cli/graph_util.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-26 21:53:17 +0200
committerGitHub <noreply@github.com>2023-06-26 15:53:17 -0400
commita8d472f88e79703b1890bfdc87d7a3bb20b21428 (patch)
treed2c2daf1261d6dbcce7852368550d56c134bc97e /cli/graph_util.rs
parentfa935e553a9ec37d39d2274432a00f1b465cef0f (diff)
feat(lock): skip saving declaration files in the lockfile (#19447)
This is also a performance improvement because declaration file hashes don't need to be stored in the lockfile. Closes #19444
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r--cli/graph_util.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index 0d3548205..1653052e5 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -144,6 +144,7 @@ pub fn graph_valid(
pub fn graph_lock_or_exit(graph: &ModuleGraph, lockfile: &mut Lockfile) {
for module in graph.modules() {
let source = match module {
+ Module::Esm(module) if module.media_type.is_declaration() => continue, // skip declaration files
Module::Esm(module) => &module.source,
Module::Json(module) => &module.source,
Module::Node(_) | Module::Npm(_) | Module::External(_) => continue,