forked from mozilla/learning.mozilla.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-convert.config.js
35 lines (34 loc) · 1.16 KB
/
image-convert.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
// This file contains a `patterns` export that describes how
// various images in the project need to be converted for
// deployment.
//
// Each key of `patterns` is a glob pattern that matches at
// least one image in the project. The value is an object with
// the following structure:
//
// * `format` is one of `'png'`, `'jpg'`, or `'gif'`, and specifies
// the format to convert the matched images to. If undefined,
// the images will retain their original format.
// * `formatParams` specifies parameters to pass to the
// image encoder. For more details, see
// https://github.com/EyalAr/lwip#get-as-a-buffer.
//
// Note that this file also exports a `reload` function, which
// can be used to dynamically reload the module's exported data.
// This was chosen as an alternative to JSON because we wanted
// the freedom to use constants and other JavaScript features to
// avoid repetition in our data.
module.exports = {
patterns: {
'img/pages/**/hero-*.png': {
format: 'jpg',
formatParams: {
quality: 70
}
}
},
reload: function() {
delete require.cache[__filename];
this.patterns = require(__filename).patterns;
}
};