fix:第一次提交,当前还有很多BUG
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import path from 'node:path'
|
||||
import { defineConfig, searchForWorkspaceRoot } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
const workspaceRoot = path.resolve(__dirname, '../..')
|
||||
const webSrc = path.resolve(__dirname, 'src')
|
||||
const crossOriginIsolationHeaders = {
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp',
|
||||
'Cross-Origin-Resource-Policy': 'same-origin'
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': webSrc,
|
||||
'next/navigation': path.resolve(__dirname, 'src/shims/next-navigation.ts')
|
||||
}
|
||||
},
|
||||
server: {
|
||||
headers: crossOriginIsolationHeaders,
|
||||
fs: {
|
||||
allow: [searchForWorkspaceRoot(process.cwd()), workspaceRoot]
|
||||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:4000',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
},
|
||||
preview: {
|
||||
headers: crossOriginIsolationHeaders
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user