补构建配置并新增 .gitignore:线上依赖的 base 与固定产物名入库
vite.config.js:加 base:'/asserts/index/'、assetsDir:''、固定产物名 (entryFileNames:'index.js' 等)。当前线上 /var/www/lionwebsite/asserts/index/ 的 index.js/index.css/index.html 均依赖此配置才能构建出来——属线上在用 但未入库的配置,不提交会导致 clone 后构建产物路径与线上不一致; index.html:favicon 改为 /asserts/favicon.ico(与线上入口一致); llm_readme.md:补文件末尾换行; 新增 .gitignore(npm 模板 + run.out):忽略 node_modules、dist、日志与编辑器文件。
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
run.out
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg"/>
|
||||
<link rel="icon" href="/asserts/favicon.ico" />
|
||||
<link rel="stylesheet" href="/src/reset.css" type="text/css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LionWebsite</title>
|
||||
|
||||
@@ -2,8 +2,21 @@ import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
// Nginx 从 /asserts/index/ 提供桌面端静态文件;部署文件名保持固定,
|
||||
// 以便根页面和现有静态路由无需随每次构建改名。
|
||||
base: '/asserts/index/',
|
||||
assetsDir: '',
|
||||
plugins: [vue()],
|
||||
server:{
|
||||
host: '0.0.0.0'
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: 'index.js',
|
||||
chunkFileNames: '[name].js',
|
||||
assetFileNames: '[name][extname]'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user