From 7da2f96bba98e5a37b3c5a9838f9aeba3b746bff Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Thu, 25 Mar 2021 21:24:22 +0100 Subject: [PATCH] Add config file directory to strapi's watchIgnoreFiles list --- README.md | 13 +++++++++++++ controllers/config.js | 14 +++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 329df55..646ac4e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,19 @@ Use `npm` or `yarn` to install and build the plugin. yarn build yarn develop +Add the export path to the `watchIgnoreFiles` list in `config/server.js`. +This way your app won't reload when you export the config in development. + + admin: { + auth: { + ... + }, + watchIgnoreFiles: [ + '**/config-sync/files/**', + ] + }, + + ## Configuration Some settings for the plugin are able to be modified by creating a file `extensions/config-sync/config/config.json` and changing the following settings: diff --git a/controllers/config.js b/controllers/config.js index 4a929c7..e5d212a 100644 --- a/controllers/config.js +++ b/controllers/config.js @@ -15,19 +15,11 @@ module.exports = { * @returns {void} */ exportAll: async (ctx) => { - if (strapi.config.get('autoReload')) { - ctx.send({ - message: `Config was successfully exported to ${strapi.plugins['config-sync'].config.destination}.` - }); - } - await strapi.plugins['config-sync'].services.main.exportAllConfig(); - if (!strapi.config.get('autoReload')) { - ctx.send({ - message: `Config was successfully exported to ${strapi.plugins['config-sync'].config.destination}.` - }); - } + ctx.send({ + message: `Config was successfully exported to ${strapi.plugins['config-sync'].config.destination}.` + }); }, /**