Created
March 14, 2019 16:31
-
-
Save philipboomy/fefa4ad9a67409462cc0a33288e3b505 to your computer and use it in GitHub Desktop.
Statamic Laravel Mix 4
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.setPublicPath('./public/themes/themename') | |
mix.postCss('src/default-src.css', 'css/themename.css') | |
.options({ | |
postCss: [tailwindcss('tailwind.config.js')], | |
processCssUrls: false, | |
}) | |
.js([ | |
'src/default-src.js', | |
], 'js/themename.js'); | |
mix.browserSync({ | |
proxy: 'http://websitename.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'), | |
], | |
folders: ['src', 'public/themes/themename/'], | |
extensions: ['html', 'js', 'php', 'vue', 'svg'], | |
}) | |
.version(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment