0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【React】sftpでuploadしてもwebpack-dev-serverで監視させる方法

Posted at

webpackはsftp監視しない問題

sftpでuploadしたものはwebpackは監視しないらしい。
reactでdevelop server立てている場合は自動更新をしなくなってしまう。

いつ使うか

vagrant等でディレクトリをマウントしている場合も同様に更新しなくなってしまう。
しかしwatchOptionsを変更することで定期更新をすることになる。

更新箇所

Reactの場合は次のファイルを更新すればOK。
node_modules > react-scripts > config > webpackDevServer.config.js

    watchOptions: {
      ignored: ignoredFiles(paths.appSrc),
      poll: 500,  //←ここを追加
    },
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?