https 替换
This commit is contained in:
@@ -4,6 +4,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import { federation } from '@module-federation/vite'
|
||||
import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import fs from 'fs'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
@@ -11,7 +12,7 @@ const __dirname = dirname(__filename)
|
||||
/**
|
||||
* Module Federation 构建配置(@module-federation/vite)
|
||||
* 官方维护版本,支持 Vite 6 + 开发模式热更新
|
||||
*
|
||||
*
|
||||
* 优势:
|
||||
* - ✅ 完整支持 Vite 开发模式
|
||||
* - ✅ dev 模式能生成 remoteEntry.js
|
||||
@@ -19,6 +20,9 @@ const __dirname = dirname(__filename)
|
||||
* - ✅ 真正的生产可用版本
|
||||
*/
|
||||
export default defineConfig({
|
||||
// Shared 模块的基础路径(通过 Nginx 代理访问)
|
||||
base: '/shared/',
|
||||
|
||||
plugins: [
|
||||
vue({
|
||||
script: {
|
||||
@@ -109,17 +113,27 @@ export default defineConfig({
|
||||
strictPort: true,
|
||||
host: true,
|
||||
cors: true,
|
||||
// HTTPS 配置(使用 mkcert 生成的本地开发证书)
|
||||
https: {
|
||||
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
|
||||
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
|
||||
},
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
preview: {
|
||||
port: 7000,
|
||||
host: true,
|
||||
cors: true,
|
||||
// HTTPS 配置(使用 mkcert 生成的本地开发证书)
|
||||
https: {
|
||||
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
|
||||
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
|
||||
},
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
|
||||
|
||||
Reference in New Issue
Block a user