Skip to content

Instantly share code, notes, and snippets.

@javdome
Last active April 22, 2020 07:35
Show Gist options
  • Save javdome/e5b1656928fdea0a4e91012e77e36653 to your computer and use it in GitHub Desktop.
Save javdome/e5b1656928fdea0a4e91012e77e36653 to your computer and use it in GitHub Desktop.
Mix + Tailwind + Purge + Sass // Stand-Alone Projects
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