Last active
June 8, 2018 17:59
-
-
Save philipboomy/c9572070b097539f2fde442ed08a7283 to your computer and use it in GitHub Desktop.
Works with latest laravel-mix
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
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