chore: 容器框架升级,修复项目命令行异常问题
This commit is contained in:
50
apps/y-code-v1/farm.config.ts
Normal file
50
apps/y-code-v1/farm.config.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import { defineConfig, loadEnv } from '@farmfe/core';
|
||||
import less from '@farmfe/js-plugin-less';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import mkcert from 'vite-plugin-mkcert';
|
||||
import qiankun from 'vite-plugin-qiankun';
|
||||
|
||||
// @ts-ignore
|
||||
export default defineConfig(({ mode }) => {
|
||||
console.log('mode', mode);
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_']);
|
||||
return {
|
||||
plugins: [less()],
|
||||
vitePlugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
mkcert(),
|
||||
qiankun('y-code-app', {
|
||||
useDevMode: env.VITE_NODE_ENV === 'development',
|
||||
}) as any,
|
||||
Components({
|
||||
resolvers: [
|
||||
AntDesignVueResolver({
|
||||
importStyle: 'less',
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
cors: true,
|
||||
port: Number(env.VITE_PORT),
|
||||
},
|
||||
|
||||
compilation: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
// output: {
|
||||
// path: path.resolve(process.cwd(), "../../dist/y-code-v1"),
|
||||
// clean: true,
|
||||
// },
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user