electron-compile icon indicating copy to clipboard operation
electron-compile copied to clipboard

Added per mimetype reload strategies and stylesheet live reloading.

Open Mike-Dax opened this issue 8 years ago • 11 comments

Per mimeType reload strategies have been added. Now you should be able to call enableLiveReload() without any arguments and get something that works very out of the box. Alternatively you can pass in an options object that contains your reload strategy.

  'strategy': {
    'text/html': 'naive',
    'text/tsx': 'react-hmr',
    'text/jsx': 'react-hmr',
    'application/javascript': 'react-hmr',
    'text/stylus': 'hot-stylesheets',
    'text/sass': 'hot-stylesheets',
    'text/scss': 'hot-stylesheets',
    'text/css' : 'hot-stylesheets'
  }

Additionally, stylesheets can now be hot reloaded. Their link.href will be reset upon the file changing.

This doesn't work for dependencies for stylesheets. I've opened an issue regarding electron-compile-compiled-file not being sent for dependencies for stylesheets in #188.

Mike-Dax avatar Feb 26 '17 11:02 Mike-Dax

This is awesome! I'm gonna have a look at this later today

anaisbetts avatar Feb 28 '17 18:02 anaisbetts

any news on this? would love hot-reload for css

szymonkaliski avatar Apr 10 '17 19:04 szymonkaliski

Yes please! Hot reloading for CSS (I use Stylus) would make this package even more amazing than it already is!

@paulcbetts @malept @mnquintana Can’t wait!

Hum4n01d avatar Apr 10 '17 23:04 Hum4n01d

Any news?

Hum4n01d avatar Apr 24 '17 18:04 Hum4n01d

I could have sworn I reviewed and merged this. I'll have a look soon now that I'm back in the US

anaisbetts avatar Apr 25 '17 11:04 anaisbetts

Ok thanks

Hum4n01d avatar Apr 25 '17 14:04 Hum4n01d

Hey @paulcbetts could you merge this? ;)

Hum4n01d avatar May 19 '17 00:05 Hum4n01d

Any news?

Hum4n01d avatar Jun 02 '17 19:06 Hum4n01d

This looks like a great change, any reason it hasnt been merged yet?

shanehyde avatar Sep 14 '17 22:09 shanehyde

Not sure... I'm waiting for this too

On Sep 14, 2017, at 3:44 PM, shanehyde [email protected] wrote:

This looks like a great change, any reason it hasnt been merged yet?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Hum4n01d avatar Sep 14 '17 22:09 Hum4n01d

Hey, this PR has been opened for a year and it looks like something every body would want. Any reason it never got merged ?

Coriou avatar Mar 25 '18 00:03 Coriou