first commit

This commit is contained in:
2025-06-12 19:37:54 +08:00
parent bb2eb010f7
commit 1c6093fa9a
87 changed files with 18432 additions and 0 deletions

46
docs/vite.config.js Normal file
View File

@@ -0,0 +1,46 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
// 使用包含编译器的Vue版本以支持运行时模板编译
'vue': 'vue/dist/vue.esm-bundler.js'
}
},
server: {
host: true,
port: 5173,
// 配置响应头确保所有文件都使用UTF-8编码
configureServer(server) {
server.middlewares.use((req, res, next) => {
const url = req.url || ''
// 为不同文件类型设置正确的Content-Type和charset
if (url.match(/\.md$/)) {
res.setHeader('Content-Type', 'text/markdown; charset=utf-8')
} else if (url.match(/\.(yaml|yml)$/)) {
res.setHeader('Content-Type', 'text/yaml; charset=utf-8')
} else if (url.match(/\.json$/)) {
res.setHeader('Content-Type', 'application/json; charset=utf-8')
} else if (url.match(/\.js$/)) {
res.setHeader('Content-Type', 'application/javascript; charset=utf-8')
} else if (url.match(/\.ts$/)) {
res.setHeader('Content-Type', 'text/typescript; charset=utf-8')
}
next()
})
}
},
build: {
outDir: 'dist',
assetsDir: 'assets',
rollupOptions: {
input: {
main: './index.html'
}
}
}
})