Skip to content

Instantly share code, notes, and snippets.

@philipboomy
Created March 14, 2019 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipboomy/fefa4ad9a67409462cc0a33288e3b505 to your computer and use it in GitHub Desktop.
Save philipboomy/fefa4ad9a67409462cc0a33288e3b505 to your computer and use it in GitHub Desktop.
Statamic Laravel Mix 4
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