-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
38 lines (34 loc) · 1001 Bytes
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module.exports = {
chainWebpack: config => {
/**
* Only perform image compression when building for
* production. This is because this takes quite long
* to perform relative to the rest of the build time.
*/
if (process.env.NODE_ENV === "production") {
const imageRule = config.module.rule("images");
imageRule.uses.clear();
/* https://github.com/tcoopman/image-webpack-loader */
imageRule
.use("file-loader")
.loader("file-loader")
.end()
.use("image-webpack-loader")
.loader("image-webpack-loader")
.options({
pngquant: {
quality: "65-80",
speed: 3
}
/**
* Find a way to generate both regular png and webp
* versions and conditionally load them depending on
* browser support (like `gatsby-image` does).
*/
// webp: {
// quality: 75
// }
});
}
}
};