mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-10-25 13:59:36 +00:00
speed up builds and load app layouts on demand
This commit is contained in:
@@ -30,10 +30,7 @@ install-deps: $(STUFFBIN)
|
||||
|
||||
# Build the frontend for production (both apps).
|
||||
.PHONY: frontend-build
|
||||
frontend-build: install-deps
|
||||
@echo "→ Building frontend for production - main app & widget..."
|
||||
@export VITE_APP_VERSION="${VERSION}" && cd ${FRONTEND_DIR} && pnpm build:main
|
||||
@export VITE_APP_VERSION="${VERSION}" && cd ${FRONTEND_DIR} && pnpm build:widget
|
||||
frontend-build: frontend-build-main frontend-build-widget
|
||||
|
||||
# Build only the main frontend app.
|
||||
.PHONY: frontend-build-main
|
||||
@@ -81,13 +78,14 @@ run-frontend-widget:
|
||||
.PHONY: build-backend
|
||||
build-backend: $(STUFFBIN)
|
||||
@echo "→ Building backend..."
|
||||
@CGO_ENABLED=0 go build -a \
|
||||
@CGO_ENABLED=0 go build \
|
||||
-ldflags="-X 'main.buildString=${BUILDSTR}' -X 'main.versionString=${VERSION}' -X 'github.com/abhinavxd/libredesk/internal/version.Version=${VERSION}' -s -w" \
|
||||
-o ${BIN} cmd/*.go
|
||||
|
||||
# Main build target: builds both frontend and backend, then stuffs static assets into the binary.
|
||||
.PHONY: build
|
||||
build: frontend-build build-backend stuff
|
||||
build: frontend-build build-backend
|
||||
@$(MAKE) --no-print-directory stuff
|
||||
@echo "→ Build successful. Current version: $(VERSION)"
|
||||
|
||||
# Stuff static assets into the binary using stuffbin.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials" />
|
||||
<link rel="apple-touch-icon" href="/images/pwa-icon-192.png" />
|
||||
<link rel="preload" href="/static/public/static/fonts/Geist-Variable.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="stylesheet" href="/static/public/static/fonts.css">
|
||||
<link rel="stylesheet" href="/static/public/static/fonts.css" vite-ignore>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import App from '@main/App.vue'
|
||||
import OuterApp from '@main/OuterApp.vue'
|
||||
import InboxLayout from '@main/layouts/inbox/InboxLayout.vue'
|
||||
import AccountLayout from '@main/layouts/account/AccountLayout.vue'
|
||||
import AdminLayout from '@main/layouts/admin/AdminLayout.vue'
|
||||
import { useAppSettingsStore } from '../stores/appSettings'
|
||||
import { getI18n } from '../i18n'
|
||||
import { abortRouteScope } from '../api'
|
||||
import { useAppSettingsStore } from '@main/stores/appSettings'
|
||||
import { getI18n } from '@main/i18n'
|
||||
import { abortRouteScope } from '@main/api'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
component: OuterApp,
|
||||
component: () => import('@main/OuterApp.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
@@ -35,7 +30,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: App,
|
||||
component: () => import('@main/App.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'contacts',
|
||||
@@ -66,7 +61,7 @@ const routes = [
|
||||
path: '/inboxes/teams/:teamID',
|
||||
name: 'teams',
|
||||
props: true,
|
||||
component: InboxLayout,
|
||||
component: () => import('@main/layouts/inbox/InboxLayout.vue'),
|
||||
meta: { titleKey: 'globals.terms.teamInbox', hidePageHeader: true },
|
||||
children: [
|
||||
{
|
||||
@@ -90,7 +85,7 @@ const routes = [
|
||||
path: '/inboxes/views/:viewID',
|
||||
name: 'views',
|
||||
props: true,
|
||||
component: InboxLayout,
|
||||
component: () => import('@main/layouts/inbox/InboxLayout.vue'),
|
||||
meta: { titleKey: 'globals.terms.view', hidePageHeader: true },
|
||||
children: [
|
||||
{
|
||||
@@ -120,7 +115,7 @@ const routes = [
|
||||
path: '/inboxes/:type(assigned|unassigned|all|mentioned)?',
|
||||
name: 'inboxes',
|
||||
redirect: '/inboxes/assigned',
|
||||
component: InboxLayout,
|
||||
component: () => import('@main/layouts/inbox/InboxLayout.vue'),
|
||||
props: true,
|
||||
meta: { titleKey: 'globals.terms.inbox', hidePageHeader: true },
|
||||
children: [
|
||||
@@ -164,7 +159,7 @@ const routes = [
|
||||
path: '/account/:page?',
|
||||
name: 'account',
|
||||
redirect: '/account/profile',
|
||||
component: AccountLayout,
|
||||
component: () => import('@main/layouts/account/AccountLayout.vue'),
|
||||
props: true,
|
||||
meta: { titleKey: 'globals.terms.account' },
|
||||
children: [
|
||||
@@ -186,7 +181,7 @@ const routes = [
|
||||
{
|
||||
path: '/admin',
|
||||
name: 'admin',
|
||||
component: AdminLayout,
|
||||
component: () => import('@main/layouts/admin/AdminLayout.vue'),
|
||||
meta: { titleKey: 'globals.terms.admin' },
|
||||
children: [
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>libredesk Chat Widget</title>
|
||||
<link rel="preload" href="/static/public/static/fonts/Geist-Variable.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="stylesheet" href="/static/public/static/fonts.css">
|
||||
<link rel="stylesheet" href="/static/public/static/fonts.css" vite-ignore>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Generated
+5
-5
@@ -1751,8 +1751,8 @@ packages:
|
||||
resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
caniuse-lite@1.0.30001784:
|
||||
resolution: {integrity: sha512-WU346nBTklUV9YfUl60fqRbU5ZqyXlqvo1SgigE1OAXK5bFL8LL9q1K7aap3N739l4BvNqnkm3YrGHiY9sfUQw==}
|
||||
caniuse-lite@1.0.30001810:
|
||||
resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}
|
||||
|
||||
caseless@0.12.0:
|
||||
resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
|
||||
@@ -5464,7 +5464,7 @@ snapshots:
|
||||
autoprefixer@10.4.20(postcss@8.5.23):
|
||||
dependencies:
|
||||
browserslist: 4.24.4
|
||||
caniuse-lite: 1.0.30001784
|
||||
caniuse-lite: 1.0.30001810
|
||||
fraction.js: 4.3.7
|
||||
normalize-range: 0.1.2
|
||||
picocolors: 1.1.1
|
||||
@@ -5528,7 +5528,7 @@ snapshots:
|
||||
|
||||
browserslist@4.24.4:
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001784
|
||||
caniuse-lite: 1.0.30001810
|
||||
electron-to-chromium: 1.5.80
|
||||
node-releases: 2.0.19
|
||||
update-browserslist-db: 1.1.2(browserslist@4.24.4)
|
||||
@@ -5556,7 +5556,7 @@ snapshots:
|
||||
|
||||
camelcase-css@2.0.1: {}
|
||||
|
||||
caniuse-lite@1.0.30001784: {}
|
||||
caniuse-lite@1.0.30001810: {}
|
||||
|
||||
caseless@0.12.0: {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user