Skip to content

Instantly share code, notes, and snippets.

@philipboomy
Last active June 8, 2018 17:59
Show Gist options
  • Save philipboomy/c9572070b097539f2fde442ed08a7283 to your computer and use it in GitHub Desktop.
Save philipboomy/c9572070b097539f2fde442ed08a7283 to your computer and use it in GitHub Desktop.
Works with latest laravel-mix
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
require('laravel-mix-purgecss');
mix.postCss('src-css/themename.css', 'css')
.options({
postCss: [tailwindcss('tailwind.js')],
processCssUrls: false,
})
.js([
'js/main.js',
], './js/themename.js');
mix.browserSync({
proxy: 'http://example.test',
browser: 'firefox',
files: ['**/*.html','/css/*.css']
});
mix.disableSuccessNotifications();
if (mix.inProduction()) {
mix.purgeCss({
enabled: true,
globs: [
path.join(__dirname, 'templates/*.html'),
path.join(__dirname, 'partials/*.html'),
path.join(__dirname, 'partials/**/*.html'),
path.join(__dirname, 'layouts/*.html'),
path.join(__dirname, 'js/**.js'),
path.join(__dirname, 'img/**.svg'),
],
extensions: ['html', 'js', 'php', 'vue', 'svg'],
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment