chore: antd 全局改为紧凑布局
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
||||
import qiankun from 'vite-plugin-qiankun'
|
||||
import yargsParser from 'yargs-parser'
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
||||
import qiankun from "vite-plugin-qiankun";
|
||||
import yargsParser from "yargs-parser";
|
||||
|
||||
const argv = yargsParser(process.argv.slice(2))
|
||||
const argv = yargsParser(process.argv.slice(2));
|
||||
|
||||
console.log(process.env.DEV_ENV)
|
||||
console.log(process.env.DEV_ENV);
|
||||
|
||||
let base: string
|
||||
let base: string;
|
||||
switch (argv.mode) {
|
||||
case 'staging':
|
||||
case 'test':
|
||||
base = 'https://custom-chart.shiyue.com/'
|
||||
break
|
||||
case 'production':
|
||||
base = 'https://custom-chart.shiyuegame.com/'
|
||||
break
|
||||
case "staging":
|
||||
case "test":
|
||||
base = "https://custom-chart.shiyue.com/";
|
||||
break;
|
||||
case "production":
|
||||
base = "https://custom-chart.shiyuegame.com/";
|
||||
break;
|
||||
default:
|
||||
base = 'http://localhost:8080/'
|
||||
base = "http://localhost:8080/";
|
||||
}
|
||||
if (process.env.DEV_ENV === 'development') {
|
||||
base = 'http://localhost:8080/'
|
||||
if (process.env.DEV_ENV === "development") {
|
||||
base = "http://localhost:8080/";
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
@@ -33,9 +33,9 @@ export default defineConfig({
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
assetFileNames: '[name]-ycode-[hash:8].[ext]',
|
||||
chunkFileNames: '[name]-ycode-[hash:8].js',
|
||||
entryFileNames: '[name]-ycode-[hash:8].js',
|
||||
assetFileNames: "[name]-ycode-[hash:8].[ext]",
|
||||
chunkFileNames: "[name]-ycode-[hash:8].js",
|
||||
entryFileNames: "[name]-ycode-[hash:8].js",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -44,7 +44,7 @@ export default defineConfig({
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
modifyVars: {
|
||||
'ant-prefix': 'ycode-ant',
|
||||
"ant-prefix": "ycode-ant",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -53,24 +53,31 @@ export default defineConfig({
|
||||
vue(),
|
||||
vueJsx(),
|
||||
Components({
|
||||
resolvers: [AntDesignVueResolver({
|
||||
importStyle: 'less',
|
||||
})],
|
||||
resolvers: [
|
||||
AntDesignVueResolver({
|
||||
importStyle: "less",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
qiankun("y-code-app", {
|
||||
useDevMode: process.env.DEV_ENV === "development",
|
||||
}),
|
||||
qiankun('y-code-app', { useDevMode: process.env.DEV_ENV === 'development' }),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
},
|
||||
},
|
||||
base,
|
||||
define: {
|
||||
_BASE_HOST_: `'${base}'`,
|
||||
},
|
||||
optimizeDeps: {
|
||||
force: true, // 强制重新预构建依赖
|
||||
},
|
||||
server: {
|
||||
hmr: true,
|
||||
host: '0.0.0.0',
|
||||
host: "0.0.0.0",
|
||||
port: 8080,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user