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

fix: add watch mode #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

josephktcheung
Copy link

@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