Skip to content

Commit

Permalink
feat: use CDN for nebula frontend assets
Browse files Browse the repository at this point in the history
  • Loading branch information
prnk28 committed Oct 9, 2024
1 parent 3637f27 commit a3edb65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,19 @@ gen-pkl:

.PHONY: build-motr build-hway build-nebula

build-hway: gen-templ gen-pkl
hway-build: gen-templ
@echo "(motr) Building Highway gateway"
go run github.com/syumai/workers/cmd/[email protected] -o ./cmd/hway/build -mode go
GOOS=js GOARCH=wasm go build -o ./cmd/hway/build/app.wasm ./cmd/hway/server.go

hway-dev:
@echo "(motr) Deploying Highway gateway"
cd cmd/hway && bun run dev

build-motr: gen-templ gen-pkl
motr-build: gen-templ gen-pkl
@echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault"
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/main.go

build-nebula:
nebula-build:
@echo "(nebula) Building nebula"
cd pkg/nebula && bun install && bun run build

Expand Down
8 changes: 4 additions & 4 deletions pkg/nebula/assets/scripts.templ
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ var (

templ Styles() {
@stylesHandle.Once() {
<link href={ "/assets/css/styles.css" } rel="stylesheet"/>
<link href={ "https://cdn.sonr.id/css/styles.css" } rel="stylesheet"/>
}
}

templ Alpine() {
@alpineHandle.Once() {
<script src={ "/js/alpine.min.js" } defer></script>
<script src={ "https://cdn.sonr.id/js/alpine.min.js" } defer></script>
}
}

templ Dexie() {
@dexieHandle.Once() {
<script src={ "/js/dexie.min.js" }></script>
<script src={ "https://cdn.sonr.id/js/dexie.min.js" }></script>
}
}

templ Htmx() {
@htmxHandle.Once() {
<script src={ "/js/htmx.min.js" }></script>
<script src={ "https://cdn.sonr.id/js/htmx.min.js" }></script>
}
}
16 changes: 8 additions & 8 deletions pkg/nebula/assets/scripts_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3edb65

Please sign in to comment.