Commit 11fc21a0 authored by Michael Iseard's avatar Michael Iseard
Browse files

Add configuration for PurgeCSS

parent 760fe997
'use strict'; // eslint-disable-line
'use strict' // eslint-disable-line
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
const {default: ImageminPlugin} = require('imagemin-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const glob = require('glob-all');
const PurgecssPlugin = require('purgecss-webpack-plugin');
const config = require('./config');
const config = require('./config')
module.exports = {
plugins: [
new ImageminPlugin({
optipng: { optimizationLevel: 2 },
gifsicle: { optimizationLevel: 3 },
pngquant: { quality: '65-90', speed: 4 },
optipng: {optimizationLevel: 2},
gifsicle: {optimizationLevel: 3},
pngquant: {quality: '65-90', speed: 4},
svgo: {
plugins: [
{ removeUnknownsAndDefaults: false },
{ cleanupIDs: false },
{ removeViewBox: false },
{removeUnknownsAndDefaults: false},
{cleanupIDs: false},
{removeViewBox: false},
],
},
plugins: [imageminMozjpeg({ quality: 75 })],
plugins: [imageminMozjpeg({quality: 75})],
disable: (config.enabled.watcher),
}),
new UglifyJsPlugin({
......@@ -31,5 +33,16 @@ module.exports = {
},
},
}),
new PurgecssPlugin({
paths: glob.sync([
'app/**/*.php',
'resources/views/**/*.php',
'resources/assets/scripts/**/*.js',
'vendor/mwdelaney/sage-bootstrap4-navwalker/*.php',
]),
safelist: [
'hr',
],
}),
],
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment