Created
July 16, 2020 18:39
-
-
Save bryandugan/c11404d8e35a253e0247807d3af7c10b to your computer and use it in GitHub Desktop.
Craft CMS Laravel Mix setup using Tailwind CSS.
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
let mix = require('laravel-mix'); | |
let autoprefixer = require('autoprefixer'); | |
let tailwindcss = require('tailwindcss'); | |
require('laravel-mix-purgecss'); | |
require('laravel-mix-favicon'); | |
require('laravel-mix-postcss-config'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Mix Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Mix provides a clean, fluent API for defining some Webpack build steps | |
| for your Craft application. By default, we are compiling the CSS | |
| file for your application, as well as bundling up your JS files. | |
| | |
*/ | |
mix | |
.setPublicPath('public/') | |
.postCss('src/css/app.pcss', 'public/css/app.css', [ | |
require('postcss-nested'), | |
tailwindcss('tailwind.config.js'), | |
autoprefixer | |
] | |
) | |
.postCssConfig() | |
.js('src/js/app.js', 'public/js/app.js') | |
.favicon({ | |
inputPath: 'src/img/favicon', | |
inputFile: '*.{jpg,png,svg}', | |
publicPath: 'public', | |
output: 'img/favicon', | |
dataFile: 'data/faviconData.json', | |
blade: 'public/img/favicon/favicon.html', | |
reload: false, | |
debug: false, | |
configPath: './realfavicongenerator-config.json' | |
}) | |
.purgeCss({ | |
enabled: mix.inProduction(), | |
folders: ['src', 'templates'], | |
extensions: ['html', 'js', 'twig', 'vue'], | |
}) | |
.browserSync({ | |
proxy: 'kelly-halloran.test', | |
files: [ | |
'public/css/**/*.css', | |
'public/js/**/*.js', | |
'templates/**/*.twig' | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment