From 876d13ef97b8ee74c6c6746170da8610da9e028a Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Wed, 5 Sep 2018 17:44:19 +0200 Subject: [PATCH] feat(serve): add ignore options (#115) * feat(serve): ignore by default the resources folder * feat(serve): add ignore options * style(serve): remove trailing comma * feat(cli): simplify the code --- src/Commands/Serve/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Commands/Serve/index.js b/src/Commands/Serve/index.js index 47d889e..4d21122 100644 --- a/src/Commands/Serve/index.js +++ b/src/Commands/Serve/index.js @@ -32,6 +32,7 @@ class Serve extends Command { { --dev : Start development server } { -w, --watch=@value : A custom set of only files to watch }, { -e, --ext=@value : A custom set of extensions to watch }, + { -i, --ignore=@value : A custom set of folders to ignore watching }, { -p, --polling : Use polling to find file changes. Also required when using Docker } { --debug?=@value: Start server in debug mode } ` @@ -122,7 +123,7 @@ class Serve extends Command { * * @return {void} */ - async handle (args, { dev, watch, debug, polling, ext }) { + async handle (args, { dev, watch, debug, ignore, polling, ext }) { const acePath = path.join(process.cwd(), 'ace') const appFile = path.join(process.cwd(), 'server.js') const exists = await this.pathExists(acePath) @@ -172,10 +173,7 @@ class Serve extends Command { }, ext: ext, legacyWatch: !!polling, - ignore: [ - process.cwd() + '/tmp/*', - process.cwd() + '/public/*' - ], + ignore: ['/tmp/*', '/resources/*', '/public/*'].concat(ignore || []).map((folder) => `${process.cwd()}/${folder}`), watch: watchDirs, stdin: false })