Closed paul121 closed 1 year ago
I've opened a merge request that implements this change for farmOS core: https://git.drupalcode.org/project/farm/-/merge_requests/73
But I think it is worth noting that this change could be useful for other projects that use farmOS-map in another framework where they are not bundling farmOS-map themselves.
I think this makes sense to me, and the changes look relatively simple. I'll defer the final decision to @symbioquine though since he has a better understanding of the considerations than I do.
Thanks @symbioquine and also thank you @vital-agronomics for funding my time on this!
This is a prerequisite for fixing this farmOS core issue where farmOS-map chunks are not loaded for maps rendered via AJAX: https://www.drupal.org/project/farm/issues/3243922
The trick is that we need to set
__webpack_public_path__
in the farmOS-map entrypointmain.js
: https://stackoverflow.com/a/51245153. I chose to add this in a separatepublicPath.js
file as recommended by the Webpack On the fly docs (see warning message). This change works when simply added to the top ofmain.js
but it raises eslint errors so a separate import makes this cleaner as well.Added a quick note about this to the "Advanced integrations" section of the README, I'm not sure if we need to include additional details there?