3 Star 3 Fork 0

Vegetable Dog Development Team/Online Learning Platform

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* @Author: Rv_Jiang
* @Date: 2022-04-27 15:56:16
* @LastEditors: Rv_Jiang
* @LastEditTime: 2022-08-17 11:48:48
* @Description:
* @Email: Rv_Jiang@outlook.com
*/
import { UserConfig, loadEnv, ConfigEnv } from 'vite';
import { createVitePlugins, createViteServer, createViteBuild } from './config';
// 路径别名
const path = require('path');
// 环境变量工具引入
import { wrapperEnv } from './config/utils';
export default ({ command, mode }: ConfigEnv): UserConfig => {
const isBuild = command === 'build';
//环境变量-全局路径
const env = loadEnv(mode, process.cwd());
const viteEnv = wrapperEnv(env);
const { VITE_PUBLIC_PATH } = viteEnv;
return {
base: VITE_PUBLIC_PATH,
plugins: createVitePlugins(isBuild),
// server: createViteServer(viteEnv),
build: createViteBuild(isBuild),
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
// server: {
// proxy: {
// '/api': {
// target: 'server.xxpure.ren:9527',
// changeOrigin: true,
// rewrite: path => path.replace(/^\/api/, ''),
// },
// },
// },
css: {
preprocessorOptions: {
scss: {
additionalData: `
@use "@/assets/styles/public.scss" as *;
`,
},
},
},
};
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vegetable-dog-development-team/online-learning-platform.git
git@gitee.com:vegetable-dog-development-team/online-learning-platform.git
vegetable-dog-development-team
online-learning-platform
Online Learning Platform
develop

搜索帮助

0d507c66 1850385 C8b1a773 1850385