-
Notifications
You must be signed in to change notification settings - Fork 6
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
manifest.json in Hot Reload mode. Is it really required? #20
Comments
@justin808 as I understand "unmanifested" helpers do not use Manifest in any case, but I need one helper method that uses Manifest in Production and does not use Manifest in Dev mode. |
That's what I did in our code based on the unmanifested concept, as the bundles are not named the same thing so I wouldn't be able to use a helper like this anyway: # helpers/webpack_helper.rb
def vendor_bundle
Rails.env.development? ? unmanifested_javascript_pack_tag("vendor-dll") : javascript_pack_tag("vendor")
end
# layouts/appplication.html.slim
= vendor_bundle |
javascript_pack_tag("vendor", dll: true) Or maybe make a new helper dll_pack_tag("vendor") and that can use the unmanifested_pack_tag("vendor") |
|
@robwise @gauravtiwari, given this issue, how can we have webpacker support the DLL? @robwise, if @gauravtiwari does not think this should get merged, should this be a separate gem or part of React on Rails. It seems very generic, so it does not make sense to put this in React on Rails. |
@justin808 DLL is nice but the setup is non-trivial and use case is pretty specific. Another gem sounds like a great idea or may be we can just document it in the README. |
Another gem to do what? All I want to do is use a helper to access the public webpacker directory without doing the manifest lookup. That's it. Nothing specifically to do with DLL, it's just an example of why someone might want to use it. Considering the extremely trivial code it takes to make this work, it's a no-brainer! |
Well, it was just an idea but the addition is pretty confusing (and name too). I understand that this might make sense for your particular use case but probably not for other people who are either just getting started or have small to medium projects to work with. Sure, because you know it 😄 Perhaps, this may be simpler: javascript_pack_tag("vendor", manifest: false) |
That API would be fine with me too, as long as we have the ability to do this one way or another I'm happy lol |
I don't mind to have an option or 2 tag helpers. But I still doubt does it ever makes sense to request Manifest for HMR via webpack-server? It still seem to me as two slightly different usecases: drop manifest for HMR and having ability to call explicit unmanifested asset helper. |
As I understand, hash from mafiest is not used in Hot reload mode.
And I can omit including manifest loader in WebPack config for Dev env.
Maybe it is worth to check hot reloading mode in javascript_pack_tag here https://github.com/shakacode/webpacker_lite/blob/master/lib/webpacker_lite/helper.rb#L63 similar to the way CSS is handled https://github.com/shakacode/webpacker_lite/blob/master/lib/webpacker_lite/helper.rb#L57
and omit Manifest.lookup ?
The text was updated successfully, but these errors were encountered: