-
Notifications
You must be signed in to change notification settings - Fork 10
HMR implementation #19
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
Conversation
|
@felixmosh this is really cool 😎! Using webpack dev server is a great idea on how to solve this issue as we only need it during development mode. I have a couple questions testing this out. The main one is when I run |
Aww, I’ve forgot... it uses a self signed ssl certificate, when I’ve tested it I’ve approved it once (open the local host link in a new tab, and approve it) |
|
Thank you @felixmosh I am sure this is local to my machine but I am having a hard time getting the self signed ssl certificate to work. When I try to open the local host link in a new tab I don't see any option to approve it in Chrome or Firefox. Can you help me find an easy way to approve the SSL Cert so I can update the readme with easy instructions for users? |
|
@felixmosh I think I solved the Cert issue but maybe not completely the browser loads the assets correctly but is not refreshing? |
|
Looks like it works, changes in Try to change styles ;) |
|
BTW, I'm thinking about a bizarre idea of a full HMR support for The idea is to make a loader which will load all Few things to handle:
But this seems like a big project :] |
|
Thanks @felixmosh I see so we get HMR on CSS and JS but not yet liquid. I am excited for your idea for a full version. There is a Liquid Loader that exists but I am not sure if it works like you would need. This would be a pretty major project and having to reload the browser for changes is much easier than restarting the server. I'll get this feature merged in. That said if you're up for it a full HMR on this project would be really cool. Happy to jump in and help with whatever I can. This was a massive update and thank you for the contribution! Really nice work you have done here 👏 |


This PR adds HMR support for
The idea is simple, in development mode we are using webpack's dev server in-order to serve static assets.
Notes:
style-loaderwhich injects styles to the js bundle, therefore, in development mode there is no need for the liquid{{ 'bundle.*.css' | asset_url | stylesheet_tag }}tags - it get's removed using the transform of.liquidfiles.{{ 'bundle.*.js' | asset_url | script_tag }}tags into script tags that points tolocalhost:9000.themkit watch modewhich syncs shopify with changes - so if.liquidfile changes, it gets written to disk &themekitupload it.development&production- in dev it ignores webpack's & js files..css&.jsfiles as expected without any.liquidmodificationsHope it helps :]