Skip to content

Commit

Permalink
[1.x] Simplify Tailwind installation (#155)
Browse files Browse the repository at this point in the history
* Remove duplicate app.css file

* Use modern Tailwind directives

* Remove redundant dependency
  • Loading branch information
jessarcher authored May 30, 2022
1 parent ac7ba75 commit 19834b6
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/Console/InstallsBladeStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ protected function installBladeStack()
'alpinejs' => '^3.4.2',
'autoprefixer' => '^10.4.2',
'postcss' => '^8.4.6',
'postcss-import' => '^14.0.2',
'tailwindcss' => '^3.0.18',
] + $packages;
});
Expand Down
6 changes: 2 additions & 4 deletions src/Console/InstallsInertiaStacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected function installInertiaVueStack()
'@vue/compiler-sfc' => '^3.2.31',
'autoprefixer' => '^10.4.2',
'postcss' => '^8.4.6',
'postcss-import' => '^14.0.2',
'tailwindcss' => '^3.0.18',
'vue' => '^3.2.31',
'vue-loader' => '^17.0.0',
Expand Down Expand Up @@ -72,10 +71,10 @@ protected function installInertiaVueStack()
$this->replaceInFile('/home', '/dashboard', app_path('Providers/RouteServiceProvider.php'));

// Tailwind / Webpack...
copy(__DIR__.'/../../stubs/default/resources/css/app.css', resource_path('css/app.css'));
copy(__DIR__.'/../../stubs/inertia-common/tailwind.config.js', base_path('tailwind.config.js'));
copy(__DIR__.'/../../stubs/inertia-common/webpack.mix.js', base_path('webpack.mix.js'));
copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json'));
copy(__DIR__.'/../../stubs/inertia-common/resources/css/app.css', resource_path('css/app.css'));
copy(__DIR__.'/../../stubs/inertia-vue/resources/js/app.js', resource_path('js/app.js'));

if ($this->option('ssr')) {
Expand Down Expand Up @@ -134,7 +133,6 @@ protected function installInertiaReactStack()
'@tailwindcss/forms' => '^0.4.0',
'autoprefixer' => '^10.4.2',
'postcss' => '^8.4.6',
'postcss-import' => '^14.0.2',
'tailwindcss' => '^3.0.18',
'react' => '^17.0.2',
'react-dom' => '^17.0.2',
Expand Down Expand Up @@ -180,10 +178,10 @@ protected function installInertiaReactStack()
$this->replaceInFile('/home', '/dashboard', app_path('Providers/RouteServiceProvider.php'));

// Tailwind / Webpack...
copy(__DIR__.'/../../stubs/default/resources/css/app.css', resource_path('css/app.css'));
copy(__DIR__.'/../../stubs/inertia-common/tailwind.config.js', base_path('tailwind.config.js'));
copy(__DIR__.'/../../stubs/inertia-common/webpack.mix.js', base_path('webpack.mix.js'));
copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json'));
copy(__DIR__.'/../../stubs/inertia-common/resources/css/app.css', resource_path('css/app.css'));
copy(__DIR__.'/../../stubs/inertia-react/resources/js/app.js', resource_path('js/app.js'));

$this->replaceInFile('.vue()', '.react()', base_path('webpack.mix.js'));
Expand Down
6 changes: 3 additions & 3 deletions stubs/default/resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 0 additions & 1 deletion stubs/default/webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const mix = require('laravel-mix');
*/

mix.js('resources/js/app.js', 'public/js').postCss('resources/css/app.css', 'public/css', [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
]);
3 changes: 0 additions & 3 deletions stubs/inertia-common/resources/css/app.css

This file was deleted.

1 change: 0 additions & 1 deletion stubs/inertia-common/webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.vue()
.postCss('resources/css/app.css', 'public/css', [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
])
Expand Down

0 comments on commit 19834b6

Please sign in to comment.