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

feat(serve): add ignore options #115

Merged
merged 4 commits into from
Sep 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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