Add config file directory to strapi's watchIgnoreFiles list

pull/4/head
Boaz Poolman 2021-03-25 21:24:22 +01:00
parent 43c8678845
commit 7da2f96bba
2 changed files with 16 additions and 11 deletions

View File

@ -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:

View File

@ -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}.`
});
},
/**