1 Star 0 Fork 606

user_10976643/JeeSite Vue3

forked from 卓源软件/JeeSite Vue3 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
卓源软件 提交于 2024-08-20 16:33 . 代码优化
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author ThinkGem
*/
import type { UserConfig, ConfigEnv } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import { readPackageJSON } from 'pkg-types';
import { resolve } from 'node:path';
import {
createBuildOptions,
createCSSOptions,
createDefineOptions,
createEsBuildOptions,
createServerOptions,
createVitePlugins,
wrapperEnv,
} from './build';
export default defineConfig(async ({ command, mode }: ConfigEnv) => {
const root = process.cwd();
const isBuild = command === 'build';
const viteEnv = wrapperEnv(loadEnv(mode, root));
const pkg = await readPackageJSON(root);
const pathResolve = (pathname: string) => resolve(root, '.', pathname);
const config: UserConfig = {
root,
base: viteEnv.VITE_PUBLIC_PATH,
define: createDefineOptions(pkg),
plugins: createVitePlugins(isBuild, viteEnv, pkg),
server: createServerOptions(viteEnv),
esbuild: createEsBuildOptions(mode),
build: createBuildOptions(viteEnv),
css: createCSSOptions(),
resolve: {
alias: {
'/@/': pathResolve('src') + '/',
'/#/': pathResolve('types') + '/',
},
},
};
return config;
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/i-love-the-code/jeesite-vue.git
git@gitee.com:i-love-the-code/jeesite-vue.git
i-love-the-code
jeesite-vue
JeeSite Vue3
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385