Skip to content

Commit

Permalink
fix: tailwindcss to vite preset
Browse files Browse the repository at this point in the history
  • Loading branch information
hkp22 committed May 15, 2024
1 parent fc1f0eb commit 8ae4e38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Presets/Vite/TailwindPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getViteConfig()
return 'css: {
postcss: {
plugins: [
require("tailwindcss")({
tailwindcss({
config: path.resolve(__dirname, "tailwind.config.js"),
}),
],
Expand All @@ -84,6 +84,7 @@ public function getViteConfig()
public function updateViteConfig($configData)
{
$configData = str_replace('%app_css_input%', 'css/app.css', $configData);
$configData = str_replace('%tailwind_import%', 'import tailwindcss from "tailwindcss";', $configData);

return str_replace('%css_config%', $this->getViteConfig(), $configData);
}
Expand Down
1 change: 1 addition & 0 deletions src/Presets/Vite/VitePresetExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function exportViteConfig()
'%theme_path%',
'%theme_name%',
'%css_config%',
'%tailwind_import%',
'%vue_import%',
'%vue_plugin_config%',
'%react_import%',
Expand Down
1 change: 1 addition & 0 deletions stubs/Presets/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import path from "path";
%tailwind_import%
%vue_import%
%react_import%

Expand Down

0 comments on commit 8ae4e38

Please sign in to comment.