Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
feat(serve): add ignore options (#115)
Browse files Browse the repository at this point in the history
* feat(serve): ignore by default the resources folder

* feat(serve): add ignore options

* style(serve): remove trailing comma

* feat(cli): simplify the code
  • Loading branch information
RomainLanz authored and thetutlage committed Sep 5, 2018
1 parent f29eb7f commit 876d13e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Commands/Serve/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
`
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 876d13e

Please sign in to comment.