Files
bssapp/ui/quasar.config.js
T

153 lines
3.6 KiB
JavaScript

// quasar.config.js
import { defineConfig } from '#q-app/wrappers'
import { execSync } from 'node:child_process'
function readGitBuildInfo () {
try {
const commitCount = execSync('git rev-list --count HEAD', { encoding: 'utf8' }).trim()
const commitHash = execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim()
return { version: `v1.0.${commitCount}`, commit: commitHash }
} catch {
return { version: 'v1.0.0', commit: 'local' }
}
}
export default defineConfig(() => {
const apiBaseUrl = (process.env.VITE_API_BASE_URL || '/api').trim()
const gitBuildInfo = readGitBuildInfo()
return {
/* =====================================================
APP INFO
===================================================== */
productName: 'Baggi BSS',
productDescription: 'Baggi Tekstil Business Support System',
/* =====================================================
BOOT FILES
===================================================== */
boot: ['dayjs', 'locale', 'resizeObserverGuard'],
/* =====================================================
GLOBAL CSS
===================================================== */
css: ['app.css'],
/* =====================================================
ICONS / FONTS
===================================================== */
extras: [
'roboto-font',
'material-icons'
],
/* =====================================================
BUILD (PRODUCTION)
===================================================== */
build: {
vueRouterMode: 'hash',
env: {
VITE_API_BASE_URL: apiBaseUrl,
APP_VERSION: gitBuildInfo.version,
APP_COMMIT: gitBuildInfo.commit
},
esbuildTarget: {
browser: ['es2022', 'firefox115', 'chrome115', 'safari14'],
node: 'node20'
},
// Cache & performance
gzip: true,
preloadChunks: true
},
/* =====================================================
DEV SERVER (LOCAL)
===================================================== */
devServer: {
server: { type: 'http' },
port: 9000,
open: true,
client: {
overlay: {
errors: true,
warnings: false,
runtimeErrors: false
}
},
// DEV proxy (CORS'suz)
proxy: [
{
context: ['/api'],
target: 'http://localhost:8080',
changeOrigin: true,
secure: false,
ws: true,
timeout: 0,
proxyTimeout: 0
}
]
},
/* =====================================================
QUASAR FRAMEWORK
===================================================== */
framework: {
config: {
notify: {
position: 'top',
timeout: 2500
}
},
lang: 'tr',
plugins: [
'Loading',
'Dialog',
'Notify'
]
},
animations: [],
/* =====================================================
SSR / PWA (DISABLED)
===================================================== */
ssr: {
prodPort: 3000,
middlewares: ['render'],
pwa: false
},
pwa: {
workboxMode: 'GenerateSW'
},
/* =====================================================
MOBILE / DESKTOP
===================================================== */
capacitor: {
hideSplashscreen: true
},
electron: {
preloadScripts: ['electron-preload'],
inspectPort: 5858,
bundler: 'packager',
builder: {
appId: 'baggisowtfaresystem'
}
},
bex: {
extraScripts: []
}
}
})