Add beautify setting for the json exports
parent
2535d76909
commit
e4b5c1d0f9
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"destination": "extensions/config/files/",
|
||||
"beautify": true,
|
||||
"exclude": []
|
||||
}
|
||||
|
|
|
@ -11,10 +11,15 @@ const util = require('util');
|
|||
|
||||
module.exports = {
|
||||
writeConfigFile: async (configName, fileContents) => {
|
||||
const json =
|
||||
strapi.plugins.config.config.beautify ?
|
||||
JSON.stringify(JSON.parse(fileContents), null, 2)
|
||||
: fileContents;
|
||||
|
||||
await strapi.fs.writePluginFile(
|
||||
'config',
|
||||
`files/${configName}.json`,
|
||||
fileContents
|
||||
json
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue