build: 打通 FastAPI 与 Vue 最小工程、依赖与数据库连接
后端入口、配置、Redis 与 Alembic 迁移就位;前端 Vite 工程可安装可构建。
This commit is contained in:
1 parent
fb0ddca4de
commit
2aee6286d6
167 files changed
+26082
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { resolve } from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue({
|
||||
template: {
|
||||
compilerOptions: {
|
||||
// Treat all tags starting with 's-' as custom elements (Polaris web components)
|
||||
isCustomElement: (tag) => tag.startsWith('s-')
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(__dirname, 'src/webclient/widget.ts'),
|
||||
name: 'ChatterMateWidget',
|
||||
fileName: 'widget',
|
||||
formats: ['es'],
|
||||
},
|
||||
outDir: '../backend/assets',
|
||||
emptyOutDir: false,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
format: 'es',
|
||||
entryFileNames: 'widget.js',
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (assetInfo.name === 'style.css') {
|
||||
return 'widget.css'
|
||||
}
|
||||
// Place other assets in a subdirectory that we can ignore or clean up later
|
||||
return 'unused/[name]-[hash][extname]'
|
||||
},
|
||||
chunkFileNames: 'unused/[name]-[hash].js',
|
||||
manualChunks: undefined, // Disable code splitting
|
||||
},
|
||||
},
|
||||
},
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user