Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using different Tailwind config files (eg. one for admin and one for front) with Laravel Mix (TailwindCSS < 1.0)
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