mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-07-09 18:20:28 +00:00
1034313fca
* allow manual website version inputs * map website downloads to release version
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path'
|
|
import pkg from './package.json'
|
|
|
|
const websiteDownloadVersion = process.env.WEBSITE_DOWNLOAD_VERSION?.trim() || pkg.version
|
|
|
|
export default defineConfig({
|
|
root: 'packages/website',
|
|
plugins: [vue()],
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
__WEBSITE_DOWNLOAD_VERSION__: JSON.stringify(websiteDownloadVersion),
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'packages/website/src'),
|
|
'@client': resolve(__dirname, 'packages/client/src'),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/styles/variables" as *;\n`,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../../dist/website',
|
|
emptyOutDir: true,
|
|
minify: 'esbuild',
|
|
sourcemap: false,
|
|
target: 'es2020',
|
|
cssCodeSplit: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
if (id.includes('vue') || id.includes('vue-router') || id.includes('vue-i18n') || id.includes('pinia')) {
|
|
return 'vue-vendor'
|
|
}
|
|
if (id.includes('naive-ui')) {
|
|
return 'ui-vendor'
|
|
}
|
|
return 'vendor'
|
|
}
|
|
},
|
|
chunkFileNames: 'assets/js/[name]-[hash].js',
|
|
entryFileNames: 'assets/js/[name]-[hash].js',
|
|
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
},
|
|
})
|