mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-13 06:05:32 -04:00
raise webpack's threshold for asset size warnings
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
"unused-javascript": "warn",
|
||||
"uses-optimized-images": "warn",
|
||||
"uses-rel-preconnect": "warn",
|
||||
"valid-source-maps": "warn",
|
||||
"modern-image-formats": "off",
|
||||
"offscreen-images": "off",
|
||||
"uses-long-cache-ttl": "off",
|
||||
|
@@ -58,7 +58,10 @@ function optimizeHtml() {
|
||||
|
||||
function optimizeImages() {
|
||||
// allow skipping this step via an env variable to save time during CI, etc.
|
||||
if (process.env.SKIP_OPTIMIZE_IMAGES === "true") return Promise.resolve("skipped");
|
||||
if (process.env.SKIP_OPTIMIZE_IMAGES === "true") {
|
||||
console.log("Skipping image optimization...");
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return gulp
|
||||
.src(["public/**/*.{gif,jpg,jpeg,png,svg}", "!public/assets/emoji/**/*"], { base: "./" })
|
||||
|
@@ -176,6 +176,7 @@ export default {
|
||||
performance: {
|
||||
// only evaluate JS and CSS file sizes (ignore source maps, images, etc.)
|
||||
assetFilter: (assetFilename) => /\.js$|\.css$/.test(assetFilename),
|
||||
maxAssetSize: 990000, // ~99 KiB
|
||||
},
|
||||
optimization: {
|
||||
sideEffects: true,
|
||||
|
Reference in New Issue
Block a user