From f0eeee8bc8d94c8b906558bf27c39a388165b2f7 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson <31214002+jaxwilko@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:42:59 +0100 Subject: [PATCH] Fix Mix webpack config not being cleaned (#1175) --- modules/system/console/asset/mix/MixCompile.php | 6 +++--- modules/system/console/asset/mix/MixWatch.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/console/asset/mix/MixCompile.php b/modules/system/console/asset/mix/MixCompile.php index 29a65c9f96..ba6ece5442 100644 --- a/modules/system/console/asset/mix/MixCompile.php +++ b/modules/system/console/asset/mix/MixCompile.php @@ -95,9 +95,9 @@ protected function beforeExecution(string $configPath): void */ protected function afterExecution(string $configPath): void { - $webpackJsPath = $this->getPackagePath($configPath); - if (File::exists($webpackJsPath)) { - File::delete($webpackJsPath); + $webpackConfigPath = $this->getJsConfigPath($configPath); + if (File::exists($webpackConfigPath) && File::isFile($webpackConfigPath)) { + File::delete($webpackConfigPath); } } } diff --git a/modules/system/console/asset/mix/MixWatch.php b/modules/system/console/asset/mix/MixWatch.php index f8d88d4a7d..0bcd213899 100644 --- a/modules/system/console/asset/mix/MixWatch.php +++ b/modules/system/console/asset/mix/MixWatch.php @@ -60,7 +60,7 @@ protected function createCommand(string $configPath): array public function handleCleanup(): void { $this->newLine(); - $this->info('Cleaning up: ' . $this->getPackagePath(base_path($this->watchingFilePath))); + $this->info('Cleaning up: ' . $this->getPackagePath($this->watchingFilePath)); $this->afterExecution(base_path($this->watchingFilePath)); } }