diff --git a/frontend/build.rs b/frontend/build.rs index 8709ed19..eb102e52 100644 --- a/frontend/build.rs +++ b/frontend/build.rs @@ -73,6 +73,10 @@ pub fn build_frontend() { // #[cfg(not(debug_assertions))] shell("yarn"); + let mut project_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + project_dir.push(FRONTEND_DIR); + std::fs::remove_dir_all(project_dir); + // Only build frontend when building a release // #[cfg(not(debug_assertions))] shell("yarn build"); @@ -85,6 +89,8 @@ pub fn move_frontend() { target.pop(); target.push(FRONTEND_DIR); + // Note: sometimes, build can fail if the previous build is still present + // What a lovely language.... let mut project_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); project_dir.push(FRONTEND_DIR);