Last active
April 22, 2020 07:35
-
-
Save javdome/e5b1656928fdea0a4e91012e77e36653 to your computer and use it in GitHub Desktop.
Mix + Tailwind + Purge + Sass // Stand-Alone Projects
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'); | |
//Requerimos Tailwind | |
const tailwindcss = require('tailwindcss'); | |
//If we use sass we will need the purgecss wrapper of Laravel-mix | |
require('laravel-mix-purgecss'); | |
// This opcion avoids to generate the file "app.js.LICENSE.txt" when is executed "npm run prod" | |
mix.options({ | |
terser: { | |
extractComments: false, | |
} | |
}); | |
mix.sass('src/input.scss', 'build/output.css') | |
.options({ | |
processCssUrls: false, | |
postCss: [ tailwindcss('./tailwind.config.js') ], | |
}) | |
.purgeCss({ | |
//Specify the paths to all of the template files in your project | |
content: [ | |
'./src/**/*.html' | |
'./src/**/*.vue', | |
'./src/**/*.jsx', | |
// etc. | |
], | |
// Include any special characters you're using in this regular expression | |
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment