diff --git a/devtools-frontend/build.rs b/devtools-frontend/build.rs index b7282967..8753395a 100644 --- a/devtools-frontend/build.rs +++ b/devtools-frontend/build.rs @@ -55,6 +55,11 @@ fn copy_devtools_dir(src: impl AsRef, dst: impl AsRef) -> io::Result if entry.file_name().to_str() == Some("node_modules") { continue; } + // In `cargo package`, each crate source files are copied to + // target/package/crate- & threre are target dir + if entry.file_name().to_str() == Some("target") { + continue; + } copy_devtools_dir(entry.path(), dst.as_ref().join(entry.file_name()))?; } else { fs::copy(entry.path(), dst.as_ref().join(entry.file_name()))?;