-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathbootstrap.js
More file actions
57 lines (54 loc) · 1.17 KB
/
bootstrap.js
File metadata and controls
57 lines (54 loc) · 1.17 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'use strict';
/**
* Upload plugin bootstrap.
*
* It initializes the provider and sets the default settings in db.
*/
module.exports = async (
{
strapi
}
) => {
// set plugin store
const configurator = strapi.store({
type: 'plugin',
name: 'responsive-image',
key: 'settings',
});
// if provider config does not exist set one by default
const config = await configurator.get();
if (!config) {
await configurator.set({
value: {
formats: [
{
name: "large",
width: 1000,
fit: "cover",
position: "centre",
withoutEnlargement: false,
convertToFormat: "",
},
{
name: "medium",
width: 750,
fit: "cover",
position: "centre",
withoutEnlargement: false,
convertToFormat: "",
},
{
name: "small",
width: 500,
fit: "cover",
position: "centre",
withoutEnlargement: false,
convertToFormat: "",
},
],
quality: 87,
progressive: true,
},
});
}
};