Closed SLaks closed 1 month ago
This also removes 2 unused PNG files
AFAICT, the GitHub action should work for future PRs after this one is merged.
pull_request_target
runs on pull requests, but uses the action config from the target branch in your repo (otherwise, it will fail because my action config cannot have access to your repo)
BTW, replacing fetch()
with import()
also has other benefits:
import()
ing JSON files is strongly typed, so we'll get compiler errors if the JSON doesn't match the type you consume it as.import()
is automatically cached, so we can remove the explicit schedule.json cache.I will probably send a followup PR to take advantage of these benefits.
If you don't want the code size cost, I should be able to use import.meta.url
to make Vite correctly resolve (and I think deploy) the JSON for fetch()
. However, that might make offline a bit more annoying to build.
See #121
Note: The individual commits in this PR do not work without the entire chain; I divided it into multiple commits just to make the changes easier to review
fetch()
with dynamicimport()
.import()
ed JS files in the optimized build.import()
ed JSON filenames to the generated JS asset filenames, which is why the main bundle is now 292KB (66KB after gzip)pacakge.json
scripts to use Vite