48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { defineConfig, loadEnv } from "@farmfe/core";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
import qiankun from "vite-plugin-qiankun";
|
|
import path from "path";
|
|
import less from "@farmfe/js-plugin-less";
|
|
import Components from "unplugin-vue-components/vite";
|
|
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
|
|
|
// @ts-ignore
|
|
export default defineConfig(({ mode }) => {
|
|
console.log("mode", mode);
|
|
const env = loadEnv(mode, process.cwd(), ["VITE_"]);
|
|
return {
|
|
plugins: [less()],
|
|
vitePlugins: [
|
|
vue(),
|
|
vueJsx(),
|
|
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,
|
|
// },
|
|
},
|
|
};
|
|
});
|