From 9ed3353589c7c3188a3fcdf99cbff698e20b6642 Mon Sep 17 00:00:00 2001 From: iam4x Date: Wed, 7 Jun 2017 09:46:48 +0200 Subject: [PATCH] chore(doc.build): dont re-build md when not needed --- docgen/start.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/docgen/start.js b/docgen/start.js index 8244b4a191..d5342a756b 100644 --- a/docgen/start.js +++ b/docgen/start.js @@ -28,18 +28,13 @@ watch([ .on('all', (event, filePath) => { // filter out plugins we dont need on some files changes // example: remove `documentationjs` when no src/ files changed. - const isSrcFileChange = event === 'change' - && filePath.includes('src/') - && !filePath.includes('docgen') - - const isSassFile = event === 'change' - && filePath.includes('docgen') - && /^[^_.].*\.s[ac]ss/.test(filePath) + const isSrcFileChange = filePath.includes('src/') && !filePath.includes('docgen') + const isSassFile = filePath.includes('docgen') && /^[^_.].*\.s[ac]ss/.test(filePath) + const isMarkdownFile = filePath.includes('docgen') && /\.md$/.test(filePath) const nextMiddlewares = middlewares - .filter(fn => - !isSrcFileChange && fn.name !== 'documentationjs' - ) + .filter(fn => !isSrcFileChange && fn.name !== 'documentationjs') + .filter(fn => !isMarkdownFile && fn.name !== 'markdown') .filter(fn => !isSassFile && (fn.name === 'bound compileSass' || fn.name === 'sassAutoprefixer') ? false