6

私はエクスプレスアプリを持っています。テンプレートエンジンとして swig を使用しています。[更新] をクリックしたときに、HTML の変更をブラウザーに反映させることはできますか? HTML の変更が必要になるたびにサーバーを再起動したくありませんか?

4

3 に答える 3

9

I got the solution from this link.

I installed supervisor module as global installation

npm install supervisor -g

I stated my app like this

supervisor -e html,js  app.js

Here i am specifying to watch the changes in files with extensions .html and .js. So when these files are changed its automatically reloaded when the next request comes.No restart required.

于 2012-12-20T07:48:00.417 に答える
1

swig のキャッシュを無効にするだけです。

if (process.env.NODE_ENV !== 'production') {
  swig.setDefaults({ cache: false });
}
于 2014-05-24T12:49:35.300 に答える
1

これにはたくさんのツールがあります:

そして、私はあなたがもっと見つけることができると確信しています.

于 2012-12-20T07:58:03.567 に答える