chore: 容器框架升级,修复项目命令行异常问题

This commit is contained in:
wangxuefeng
2025-03-11 10:05:28 +08:00
parent de679d4289
commit 3e1a1b4a66
1187 changed files with 95352 additions and 12509 deletions

View File

@@ -0,0 +1,39 @@
import path from 'node:path';
import { defineConfig, loadEnv } from '@farmfe/core';
import vue from '@vitejs/plugin-vue';
import mkcert from 'vite-plugin-mkcert';
// @ts-ignore
export default defineConfig(({ mode }) => {
console.log('mode', mode);
const env = loadEnv(mode, process.cwd(), ['VITE_', 'Y_CODE_']);
return {
server: {
port: Number(env.VITE_PORT),
cors: true,
},
// @ts-ignore coding
vitePlugins: [vue(), mkcert({ source: 'coding' })],
compilation: {
resolve: {
alias: {
'@': path.resolve(process.cwd(), 'src'),
$vtj: path.resolve(process.cwd(), '.vtj'),
},
},
define: {
// 注入环境变量到客户端
'process.env': JSON.stringify(env),
},
// output: {
// path: path.resolve(process.cwd(), "../../dist/renderer"),
// clean: true,
// },
script: {
target: 'es2022',
},
},
};
});