Avoid write files if not development environment

This commit is contained in:
Abdón Rodríguez Davila 2018-12-19 19:25:52 +01:00
parent 1233d5fac9
commit a5dc07c0a5
2 changed files with 8 additions and 2 deletions

View File

@ -266,8 +266,10 @@ module.exports = {
resolvers,
});
// Write schema.
this.writeGenerateSchema(graphql.printSchema(schema));
if (strapi.config.environment === 'development') {
// Write schema.
this.writeGenerateSchema(graphql.printSchema(schema));
}
// Remove custom scaler (like Upload);
typeDefs = Types.removeCustomScalar(typeDefs, resolvers);

View File

@ -88,6 +88,10 @@ module.exports = async function() {
return;
}
if (strapi.config.environment !== 'development') {
return;
}
// arrange system directories
await Promise.all([
fs.remove(sourcePath),