fix(docker): dynamically determine the chunk to inject during runtime

The __APP_INJECTED_RUNTIME_CONFIG__ value is not always in the main
chunk, so we need to find the right chunk to inject for runtime config.
This commit is contained in:
Jacob Wejendorp
2020-06-12 19:42:19 +02:00
parent 9d28108cb8
commit d95244c09b
+1 -1
View File
@@ -22,7 +22,7 @@ function inject_config() {
>&2 echo "Runtime app config: $config"
local main_js
main_js="$(ls /usr/share/nginx/html/main.*.chunk.js)"
main_js="$(grep -l __APP_INJECTED_RUNTIME_CONFIG__ /usr/share/nginx/html/*.chunk.js)"
echo "Writing runtime config to ${main_js}"
# escape ' and " twice, for both sed and json