6 Star 40 Fork 1.3K

余或非 / SCUI_VITE

forked from sakuya / SCUI 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
Maocat 提交于 2022-07-02 01:00 . 两处细节微调
import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
base:'./',
plugins: [vue()],
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
alias: {
// 设置路径
'~': path.resolve(__dirname, './'),
// 设置别名
'@': path.resolve(__dirname, './src')
},
// https://cn.vitejs.dev/config/#resolve-extensions
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
// vite 相关配置
server: {
port: 2800,
host: true,
open: true,
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/api': {
target: 'https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/api/, '')
}
},
},
css: {
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove();
}
}
}
}
],
},
},
})
JavaScript
1
https://gitee.com/maocat/scui_vite.git
git@gitee.com:maocat/scui_vite.git
maocat
scui_vite
SCUI_VITE
master

搜索帮助