From 0e757aa4bf93c5b85300af4fce8731ca2ba00e21 Mon Sep 17 00:00:00 2001 From: familyfriendlymikey Date: Mon, 15 Aug 2022 15:45:29 -0400 Subject: [PATCH] use imba build instead of imbac to build service worker as module so I can import version from package.json to sw.imba --- package.json | 6 +++--- sw.imba | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 29c3465..d9816fc 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "fuzzyhome", - "version": "0.1.1", + "version": "0.1.2", "scripts": { "start": "imba run -SMH --baseurl . -w server.imba", "build-app": "rm -rf dist && imba build -SMH --baseurl . server.imba", - "build-sw": "imbac sw.imba -o dist/public", + "build-sw": "imba build -SMH sw.imba -o dist/public", "build": "npm run build-app && npm run build-sw", "pages": "npx gh-pages --no-history --dotfiles --dist dist/public --branch deploy", - "static": "cd dist/public && echo http://localhost:8000 && python3 -m http.server &>/dev/null", + "static": "npm run build && cd dist/public && echo http://localhost:8000 && python3 -m http.server &>/dev/null", "deploy": "npm run build && npm run pages" }, "dependencies": { diff --git a/sw.imba b/sw.imba index bc915c5..3483da5 100644 --- a/sw.imba +++ b/sw.imba @@ -1,8 +1,10 @@ let p = console.log +import { version } from './package.json' const app_prefix = "fuzzyhome_cache" -const version = "0.1.1" const cache_name = "{app_prefix}-{version}" +p "service worker for fuzzyhome version {version}" + let urls = [ './', './__assets__/all.css'