-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix: add support for non-root base-href #75
base: main
Are you sure you want to change the base?
fix: add support for non-root base-href #75
Conversation
if a web-app is deployed using `--base-href` during build, the URLs starting with `./assets` won't work anymore. Use `assetManager` to properly resolve them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@holzgeist Before I run the workflow, there is one thing that I need you to do.
In other words, we need to move assets/no_sleep.js
into the lib
folder as per this StackOverflow post. Eventually, it'll be under wakelock_plus/lib/assets/no_sleep.js
. The reason being is that it should be moved there so that it's in line with how every other library exposes assets to its users.
You'll also have to modify the existing asset entry in pubspec.yaml
so that it points to packages/assets/wakelock_plus/assets/no_sleep.js
.
@holzgeist Please let me know if you're still gonna work on this change. Otherwise, I can commandeer it for you and take it to the finish line. Thanks. |
Hi @diegotori , thanks for the feedback. I'm going to work on it, probably today, maybe tomorrow |
@diegotori actually I need to solve some other issues before I have a working web-build to test this one. If you could commandeer this, it would be great, thanks 🙏 |
…ed to when its added to the registrar.
@holzgeist please verify the fixes made to this PR. I was able to do a bit of cleanup and/or fixes. Thanks. |
…a script element.
…hat it awaits asynchronous calls from the various wakelock related callbacks. As a result, the Dart layer no longer needs to manually await before calling WakelockPlus.enabled.
@holzgeist If you have an angle on the latest @ditman the above also applies to you as well, if you're able to review the JS changes that I made. Thanks. |
Description
if a web-app is deployed using
--base-href=/path/to/deployed/flutter/app
during build, the URLs starting with./assets
won't work anymore. Using assetManager will properly resolve them. It usesassetBase
from the loader config specified hereNB⚠️
I only tested the
url.startsWith('assets/')
code path as it's the only one used in the library. It should work the same for./
though