-
-
Save mgussekloo/67da46c0560e0833504a85cb2071db67 to your computer and use it in GitHub Desktop.
Using different Tailwind config files (eg. one for admin and one for front) for Laravel Mix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
const tailwindcss = require('tailwindcss'); | |
require('laravel-mix-purgecss'); | |
mix | |
.js('resources/js/admin/admin.js', 'public/js') | |
.js('resources/js/front/front.js', 'public/js') | |
// Admin | |
.sass( | |
'resources/sass/admin.scss', | |
'public/css/', | |
{}, // sass-loader plugin options | |
[tailwindcss('./tailwind-admin.js')] // postcss plugins | |
) | |
// Front | |
.sass( | |
'resources/sass/front.scss', | |
'public/css/', | |
{}, // sass-loader plugin options | |
[tailwindcss('./tailwind-front.js')] // postcss plugins | |
) | |
.options({ | |
processCssUrls: false, | |
}) | |
.sourceMaps(); | |
if (mix.inProduction()) { | |
mix | |
.version() | |
.purgeCss(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment