1 Star 2 Fork 2

Leslie / LeslieBlog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 973 Bytes
一键复制 编辑 原始数据 按行查看 历史
Leslie 提交于 2024-02-26 21:35 . build:修改配置文件
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
//导入plugin配置
import createVitePlugins from './vite/plugins'
export default defineConfig(({ mode }) => {
//环境变量
const env = loadEnv(mode, process.cwd(), '')
//vite配置
return {
base: '/',
plugins: createVitePlugins(),
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
//配置全局SCSS变量
css: {
preprocessorOptions: {
scss: {
additionalData: `
@use "@/assets/styles/element/index.scss" as *;
@use "@/assets/styles/variables.scss" as *;
`
}
}
},
server: {
host: '192.168.0.106',
port: 3344,
proxy: {
'/proxy': {
target: env.VITE_APP_API_BASEURL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/proxy/, '')
}
}
}
}
})
1
https://gitee.com/Lyf-622/LeslieBlog.git
git@gitee.com:Lyf-622/LeslieBlog.git
Lyf-622
LeslieBlog
LeslieBlog
master

搜索帮助