From e4b5c1d0f99688fb501416156f7dc3590ffd34d0 Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Fri, 19 Mar 2021 22:27:29 +0100 Subject: [PATCH] Add beautify setting for the json exports --- config/config.json | 1 + services/config.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/config.json b/config/config.json index 1adb4eb..618bde1 100644 --- a/config/config.json +++ b/config/config.json @@ -1,4 +1,5 @@ { "destination": "extensions/config/files/", + "beautify": true, "exclude": [] } diff --git a/services/config.js b/services/config.js index e8ed75a..bd582dc 100644 --- a/services/config.js +++ b/services/config.js @@ -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 ); },