Add entryPointBaseUrl support for web workers
Introduces the entryPointBaseUrl property to configuration in index.html and flutter_bootstrap.js, and updates python.js to use this base URL when creating Python web workers. This change allows for more flexible deployment scenarios where the entry point base URL may differ.
This commit is contained in:
parent
b89da8ac93
commit
4d71b7501d
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
var flutterConfig = {
|
||||
multiViewEnabled: flet.multiView,
|
||||
entryPointBaseUrl: flet.entryPointBaseUrl,
|
||||
assetBase: flet.assetBase
|
||||
};
|
||||
if (flet.webRenderer != "auto") {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
multiView: false,
|
||||
noCdn: "{{ cookiecutter.no_cdn }}".toLowerCase() == "true",
|
||||
webSocketEndpoint: "/ws",
|
||||
entryPointBaseUrl: "/",
|
||||
assetBase: "/",
|
||||
routeUrlStrategy: "{{ cookiecutter.route_url_strategy }}",
|
||||
canvasKitBaseUrl: "/canvaskit/",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ globalThis.jsConnect = async function(appId, args, dartOnMessage) {
|
|||
};
|
||||
console.log(`Starting up Python worker: ${appId}, args: ${args}`);
|
||||
_apps[appId] = app;
|
||||
app.worker = new Worker("python-worker.js");
|
||||
app.worker = new Worker((flet.entryPointBaseUrl.endsWith("/") ?
|
||||
flet.entryPointBaseUrl.slice(0, -1) : flet.entryPointBaseUrl) + "python-worker.js");
|
||||
|
||||
var error;
|
||||
app.worker.onmessage = (event) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue