Skip to content

Commit

Permalink
Removes default Tailwind file during install.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cintra committed Oct 19, 2024
1 parent 59fa5d7 commit f06cf20
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Console/InstallerTraits/FrontendPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ protected function installFrontendPackages(): void

] + $packages);

$this->removeDefaultTailwindConfig();

// Config files...
copy(__DIR__.'/../../../stubs/stack-configs/postcss.config.cjs', base_path('postcss.config.cjs'));
copy(__DIR__.'/../../../stubs/stack-configs/tailwind.config.cjs', base_path('tailwind.config.cjs'));
Expand Down Expand Up @@ -106,4 +108,20 @@ protected function runCommands(array $commands): void
$this->output->write(' '.$line);
});
}

protected function removeDefaultTailwindConfig(): void
{
$tailwindConfigPath = base_path('tailwind.config.js');

if (! file_exists($tailwindConfigPath)) {
return;
}

try {
unlink($tailwindConfigPath);
$this->info('Default tailwind.config.js removed.');
} catch (\Exception $e) {
$this->error('Unable to remove default tailwind.config.js. Please check file permissions.');
}
}
}

0 comments on commit f06cf20

Please sign in to comment.