Disable offline caching during development
This makes development easier as always the latest version is used.
This commit is contained in:
parent
1ea0172f94
commit
3649d3453d
|
@ -78,6 +78,10 @@ The finished web app is found in the `docs/` folder (this is so that you can eas
|
||||||
|
|
||||||
You can test the template app at <https://emilk.github.io/eframe_template/>.
|
You can test the template app at <https://emilk.github.io/eframe_template/>.
|
||||||
|
|
||||||
|
### Web testing/development
|
||||||
|
|
||||||
|
Open `index.html#dev` to disable caching, which makes development easier.
|
||||||
|
|
||||||
## Updating egui
|
## Updating egui
|
||||||
|
|
||||||
As of 2022, egui is in active development with frequent releases with breaking changes. [eframe_template](https://github.com/emilk/eframe_template/) will be updated in lock-step to always use the latest version of egui.
|
As of 2022, egui is in active development with frequent releases with breaking changes. [eframe_template](https://github.com/emilk/eframe_template/) will be updated in lock-step to always use the latest version of egui.
|
||||||
|
|
|
@ -66,12 +66,12 @@ echo "Finished: docs/${CRATE_NAME_SNAKE_CASE}.wasm"
|
||||||
if [[ "${OPEN}" == true ]]; then
|
if [[ "${OPEN}" == true ]]; then
|
||||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
# Linux, ex: Fedora
|
# Linux, ex: Fedora
|
||||||
xdg-open http://localhost:8080/index.html
|
xdg-open http://localhost:8080/index.html#dev
|
||||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||||
# Windows
|
# Windows
|
||||||
start http://localhost:8080/index.html
|
start http://localhost:8080/index.html#dev
|
||||||
else
|
else
|
||||||
# Darwin/MacOS, or something else
|
# Darwin/MacOS, or something else
|
||||||
open http://localhost:8080/index.html
|
open http://localhost:8080/index.html#dev
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -159,7 +159,8 @@
|
||||||
|
|
||||||
<!--Register Service Worker-->
|
<!--Register Service Worker-->
|
||||||
<script>
|
<script>
|
||||||
if ('serviceWorker' in navigator) {
|
// We disable caching during development so that we always view the latest version.
|
||||||
|
if ('serviceWorker' in navigator && window.location.hash !== "#dev") {
|
||||||
window.addEventListener('load', function() {
|
window.addEventListener('load', function() {
|
||||||
navigator.serviceWorker.register('/sw.js');
|
navigator.serviceWorker.register('/sw.js');
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@ PORT=8080
|
||||||
# Starts a local web-server that serves the contents of the `doc/` folder,
|
# Starts a local web-server that serves the contents of the `doc/` folder,
|
||||||
# which is the folder to where the web version is compiled.
|
# which is the folder to where the web version is compiled.
|
||||||
|
|
||||||
echo "open http://localhost:$PORT"
|
echo "open http://localhost:$PORT/index.html#dev"
|
||||||
|
|
||||||
(cd docs && basic-http-server --addr 127.0.0.1:$PORT .)
|
(cd docs && basic-http-server --addr 127.0.0.1:$PORT .)
|
||||||
# (cd docs && python3 -m http.server $PORT --bind 127.0.0.1)
|
# (cd docs && python3 -m http.server $PORT --bind 127.0.0.1)
|
||||||
|
|
Loading…
Reference in a new issue