-4

How do I setup live code reload, kind of like meteor, with featherjs?

Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
  • It's poor form to downvote without giving feedback. A downvote tells the user "bad", but it doesn't tell the user why. Feel free to comment. – Brandon Bertelsen Jun 30 '17 at 19:34

3 Answers3

3

Nodemon installs automatically via CLI. To run it just type npm run dev.

Alex Gusev
  • 787
  • 7
  • 9
2

Step 1. Install nodemon in your app directory:

npm install --save-dev nodemon

Step 2. Add the following to your package.json file, in the scripts section:

...
  },
  "scripts": {
    "test": "npm run eslint && npm run mocha",
    "dev": "./node_modules/nodemon/bin/nodemon.js src/",
    "eslint": "eslint src/. test/. --config .eslintrc.json",
    "start": "node src/",
    "mocha": "mocha test/ --recursive"
  }
...

Step 3. Run the script using:

npm run dev
Kent V
  • 545
  • 5
  • 16
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
  • Isn't calling `nodemon src/` by default is watching to the `src directory`? so `--watch src` is not necessary. – Jalil Jun 29 '17 at 08:44
0

If you are building a featherjs application in typescript, you need to use ts-node-dev to enable hot-reload for your application.

Add it by running the following command:

npm install --save-dev ts-node-dev

Next step is just to add the following script to your package.json

"start": "ts-node-dev --no-notify --exit-child src/"

If there is a better way, please feel free to reply to this thread for future references.

Mini-Man
  • 140
  • 7