Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with hot module replacement for imports #11

Open
knewter opened this issue Jan 1, 2017 · 1 comment
Open

Doesn't seem to work with hot module replacement for imports #11

knewter opened this issue Jan 1, 2017 · 1 comment

Comments

@knewter
Copy link
Contributor

knewter commented Jan 1, 2017

The problem

When using this in the polymer branch's style, and dealing with styles, you have to refresh the entire webpack server in order to see any changes take place :(

Towards a solution?

I've forked the polymer example and made a slight modification to show what I'm trying to do:

https://github.com/knewter/elm-webpack-starter/tree/polymer_hot

If you run that, there's a theme file that makes the background red. For ideal style development, it would be nice if hot module replacement were supported (even for 'imported' files), so that when you changed the theme file the browser updated accordingly.

I made the loader sort of kind of try to work with hot module replacement. I have no idea what remains to be done or if this is stupid, and I did it against the transpiled code, but you can find it here: https://github.com/knewter/elm-webpack-starter/blob/polymer_hot/loader.js#L359-L381

I'm not sure what could be done to make this work but at present working on a project that uses this is pretty unfortunate when dealing with styling because the feedback loop requires me to restart the webpack server every single time to take the changes :( (though technically I can explicitly change the actual webpack required file and then refresh - still breaks HMR)

I was wondering if you wanted to pair to see what or if we could work through it. Otherwise, I'll look at it later I'm sure. Just wanted to write this up while it was fresh on my mind. Thanks for the software!

@aitoroses
Copy link
Owner

As we talked @knewter, the refresh that @caleblloyd implemented in #2 might be a workaround but still I have to find a way to make the HMR work!

There's still a small limitation in webcomponents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants