New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gatsby-plugin-node-reload

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-node-reload

Restart Gatsby automatically when gatsby-node (and others) changes

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Gatsby Reload

Restart Gatsby's process when gatsby-* files changes (gatsby-node, gatsby-config, gatsby-browser, and gatsby-ssr).

Install

yarn add gatsby-plugin-node-reload
// gatsby-config.js

module.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:

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:

// gatsby-config.js

module.exports = {
  plugins: [
    resolve: 'gatsby-plugin-node-reload',
    options: {
      watch: ['./directory-to-watch', './file-to-watch.js']
    }
  ]
}

Keywords

gatsby

FAQs

Package last updated on 18 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts