初始化web版本MyReader
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
const PREFERRED_PORT = 1234
|
||||
|
||||
export default defineConfig({
|
||||
/** 部署在子路径 `https://域名/reader/` 时必须设置,否则 JS/CSS 会去请求 `/assets/` 根路径而 404 */
|
||||
base: '/reader/',
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: PREFERRED_PORT,
|
||||
strictPort: false,
|
||||
open: true,
|
||||
// 经域名 / 反代访问开发服务器时放行 Host(与 preview 一致)
|
||||
allowedHosts: ['huangzjsecret.online', 'www.huangzjsecret.online', 'localhost', '127.0.0.1']
|
||||
},
|
||||
preview: {
|
||||
port: PREFERRED_PORT,
|
||||
strictPort: false,
|
||||
// Nginx 会把 Host 原样转发,需与浏览器地址栏域名一致
|
||||
allowedHosts: ['huangzjsecret.online', 'www.huangzjsecret.online', 'localhost', '127.0.0.1']
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user