1. Go to this page and download the library: Download dxgx/blade-tailwind-extract library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dxgx / blade-tailwind-extract example snippets
return [
// CSS output file path
'css_output_path' => resource_path('css/tw-extracted.css'),
// Class prefix (default: TW)
'class_prefix' => 'TW',
// Hash length for file-based collision avoidance (default: 4)
'hash_length' => 4,
// Default search path when using pattern matching
'search_path' => resource_path('views'),
// Directories to ignore during file scanning
'ignored_directories' => [
'./vendor/',
'vendor/',
'./node_modules/',
'node_modules/',
],
// Reserved Tailwind classes that cannot be extracted
// These use parent-child selectors that break when extracted to @apply
// Also checks for variants like 'group/' and 'peer/'
'reserved_classes' => [
'group',
'peer',
],
// Safety limit for extraction loops
'max_iterations' => 10,
];