Skip to content

Instantly share code, notes, and snippets.

@djwave28
Last active February 4, 2020 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djwave28/3db949a782d03ef492917fac319708ef to your computer and use it in GitHub Desktop.
Save djwave28/3db949a782d03ef492917fac319708ef to your computer and use it in GitHub Desktop.
mix with tailwinds + postcss
const mix = require('laravel-mix');
require('laravel-mix-purgecss');
/*
Using tailwinds @apply command will throw an error when compiling through postcss
-- fixes `@apply` cannot be used with
Generate the full tailwinds library with
# npx tailwind init tailwindcss.full.js --full
*/
mix.js('resources/js/app.js', 'public/js');
mix.sass('resources/sass/app.scss', 'public/css')
.options({
processCssUrls: false,
postCss: [
require('postcss-css-variables')(),
require('postcss-import')(),
require('postcss-nesting')(),
require('tailwindcss')('./tailwind.config.js'),
require('tailwindcss')('./tailwindcss.full.js'),
]
})
.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