Skip to content
This repository was archived by the owner on Sep 10, 2019. It is now read-only.

fix: add watch mode#46

Open
josephktcheung wants to merge 2 commits intogramps-graphql:masterfrom
josephktcheung:feature/watch_mode
Open

fix: add watch mode#46
josephktcheung wants to merge 2 commits intogramps-graphql:masterfrom
josephktcheung:feature/watch_mode

Conversation

@josephktcheung
Copy link
Copy Markdown

@josephktcheung josephktcheung commented Feb 18, 2018

This is to fix #45.

Added watch flag to enable watch mode.

If watch mode is toggled on:

  1. the cli won't exit if error occurs, only prints error.
  2. every time a file inside a data source directory is saved:
    1. it will clear all data sources' files (e.g. transpiled code / node_modules files) in require.cache. What that means is that next time the server loads, it will not load it from the cache, but read the file again. (Inspired by this article)
    2. On changes to the file we reattach the http server listener from old Express app to the new one. (Inspired by this article)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch mode for local development

1 participant