Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d4rekanguok/gatsby-plugin-node-reload
Restart Gatsby automatically when gatsby-node (and others) changes
https://github.com/d4rekanguok/gatsby-plugin-node-reload
gatsby gatsby-plugin
Last synced: about 2 months ago
JSON representation
Restart Gatsby automatically when gatsby-node (and others) changes
- Host: GitHub
- URL: https://github.com/d4rekanguok/gatsby-plugin-node-reload
- Owner: d4rekanguok
- Archived: true
- Created: 2020-01-18T17:19:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T18:03:59.000Z (almost 5 years ago)
- Last Synced: 2024-11-06T10:51:31.557Z (about 2 months ago)
- Topics: gatsby, gatsby-plugin
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-list - gatsby-plugin-node-reload - node (and others) changes | d4rekanguok | 9 | (JavaScript)
README
![gatsby-plugin-node-reload](assets/gatsby-plugin-node-reload.png)
# Gatsby Reload
Restart Gatsby's process when `gatsby-*` files changes (`gatsby-node`, `gatsby-config`, `gatsby-browser`, and `gatsby-ssr`).
## Install
```bash
yarn add gatsby-plugin-node-reload
``````js
// gatsby-config.jsmodule.exports = {
plugins: [
'gatsby-plugin-node-reload',
]
}
```## Important: End the newly spawned process
This plugin works by ending the current process when a watched file changes & replace it with a new one. This newly spawned child process will then write output to the same terminal window. However, `cmd + C` will not end the new process. You'd have to end it manually.
At the beginning of the new process, this plugin will output the new process' PID so you can end it manually:
```bash
info PID: 5894
```Then, on MacOS, you can end the new process by doing the following:
```
kill -15 5894
```## Options
Add additional files to watch:
```js
// gatsby-config.jsmodule.exports = {
plugins: [
resolve: 'gatsby-plugin-node-reload',
options: {
watch: ['./directory-to-watch', './file-to-watch.js']
}
]
}
```