perf: only process images when building for production
This commit is contained in:
parent
d0b191706b
commit
3adbabc7da
1 changed files with 23 additions and 21 deletions
|
@ -51,6 +51,7 @@ module.exports = {
|
||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === "production") {
|
||||||
config.module
|
config.module
|
||||||
.rule("images")
|
.rule("images")
|
||||||
.test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i)
|
.test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i)
|
||||||
|
@ -72,5 +73,6 @@ module.exports = {
|
||||||
};
|
};
|
||||||
return { ...options, ...newOpts };
|
return { ...options, ...newOpts };
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue