Last active
April 20, 2020 22:24
-
-
Save viirre/994d2dc6ac2036cbbd3fde450551e509 to your computer and use it in GitHub Desktop.
Using different Tailwind config files (eg. one for admin and one for front) with Laravel Mix (TailwindCSS < 1.0)
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