Remove attempt at dynamically generating SPA content
We just do it with vite now.
This commit is contained in:
parent
1a53d5338f
commit
f22ddd0405
1 changed files with 1 additions and 27 deletions
28
default.nix
28
default.nix
|
|
@ -52,31 +52,5 @@ pnpm generate-icons
|
|||
# Build frontend
|
||||
pnpm build-rmo
|
||||
pnpm build-sync
|
||||
cp vite/rmo/index.html static/gen/rmo/index.html
|
||||
cp vite/sync/index.html static/gen/sync/index.html
|
||||
|
||||
# Extract the hash from bundle.[hash].js
|
||||
RMO_BUNDLE_FILE=$(ls vite/rmo/static/gen/js/bundle.*.js | grep -v '.map$' | head -n1)
|
||||
RMO_BUNDLE_HASH=$(basename "$RMO_BUNDLE_FILE" | sed 's/bundle\.\(.*\)\.js/\1/')
|
||||
SYNC_BUNDLE_FILE=$(ls vite/sync/static/gen/js/bundle.*.js | grep -v '.map$' | head -n1)
|
||||
SYNC_BUNDLE_HASH=$(basename "$SYNC_BUNDLE_FILE" | sed 's/bundle\.\(.*\)\.js/\1/')
|
||||
|
||||
# Extract the hash from style.[hash].css
|
||||
RMO_STYLE_FILE=$(ls vite/rmo/static/gen/css/style.*.css | head -n1)
|
||||
RMO_STYLE_HASH=$(basename "$RMO_STYLE_FILE" | sed 's/style\.\(.*\)\.css/\1/')
|
||||
SYNC_STYLE_FILE=$(ls vite/sync/static/gen/css/style.*.css | head -n1)
|
||||
SYNC_STYLE_HASH=$(basename "$SYNC_STYLE_FILE" | sed 's/style\.\(.*\)\.css/\1/')
|
||||
|
||||
# Generate gen.go with bundle path
|
||||
cat > static/gen.go <<EOF
|
||||
package static
|
||||
|
||||
// Generated by Nix build - do not edit manually
|
||||
const BundlePathRMOCSS = "/static/gen/css/style.$STYLE_HASH.css"
|
||||
const BundlePathRMOJS = "/static/gen/js/bundle.$BUNDLE_HASH.js"
|
||||
const BundlePathSyncCSS = "/static/gen/css/style.$STYLE_HASH.css"
|
||||
const BundlePathSyncJS = "/static/gen/js/bundle.$BUNDLE_HASH.js"
|
||||
EOF
|
||||
echo "Generated static/gen.go"
|
||||
'';
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue