Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Website
Commits
11fc21a0
Commit
11fc21a0
authored
Oct 05, 2020
by
Michael Iseard
Browse files
Add configuration for PurgeCSS
parent
760fe997
Changes
1
Hide whitespace changes
Inline
Side-by-side
resources/assets/build/webpack.config.optimize.js
View file @
11fc21a0
'
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
'
,
],
}),
],
}
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment