insin / nwb

A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)
Other
5.57k stars 335 forks source link

Can't disable hot module reloading via middleware #344

Open xzilja opened 7 years ago

xzilja commented 7 years ago

no matter what options I tried i.e.

app.use(require('nwb/express')(express, { reload: false, hmre: false }));

I can still see logs for HMR in browser console, trying to disable it in order to improve dev experience as it is sometimes to laggy in chrome for some reason. Is this broken or maybe docs are outdated on how to disable it in custom server.js?

insin commented 7 years ago

hmre is specifically for disabling use of React Transform and reload is used to configure webpack-hot-middleware's client - doing this would involve adding another option to skip using webpack-hot-middleware and its client entirely:

The following is a bit of a mess at the moment, it was only added to allow Karma tests to disable HMR and can't be configured externally yet. I think we need a single flag to disable all this stuff:

javadbat commented 5 years ago

I can't believe you still don't let us disable hot reload and just watch for a change