chore: 容器框架升级,修复项目命令行异常问题
This commit is contained in:
39
apps/renderer/farm.config.ts
Normal file
39
apps/renderer/farm.config.ts
Normal 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',
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user