Skip to content

Instantly share code, notes, and snippets.

@craigrodway
Created December 26, 2021 10:42
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 craigrodway/50829b6ed3cb670a4e75518418b78894 to your computer and use it in GitHub Desktop.
Save craigrodway/50829b6ed3cb670a4e75518418b78894 to your computer and use it in GitHub Desktop.
let mix = require('laravel-mix');
require('laravel-mix-purgecss');
function outPath(name, ext) {
var basePath = `public_html/site/templates/assets/${name}`;
return mix.inProduction() ? `${basePath}.min.${ext}` : `${basePath}.${ext}`;
}
mix.setPublicPath('public_html');
mix.sass('src/scss/main.scss', outPath('main', 'css'))
.purgeCss({
extend: {
content: [
`public_html/site/hooks/**/*.php`,
`public_html/site/modules/**/*.php`,
`public_html/site/modules/**/*.module`,
`public_html/site/templates/**/*.php`,
],
safelist: {
standard: [
// /column/,
/^m[a-z]-/,
/^p[a-z]-/,
/^p-/,
/^m-/,
/^up-/,
/^notie/,
/^notice/,
/^fa/,
],
greedy: [/column/]
}
},
enabled: false,
});
mix.js('src/js/main.js', outPath('main', 'js'));
mix.copyDirectory('node_modules/@fortawesome/fontawesome-free', `public_html/site/templates/resources/fa`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment