feat: first commit
This commit is contained in:
52
admin/vite.config.ts
Normal file
52
admin/vite.config.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { defineConfig,loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import svgrPlugin from '@arco-plugins/vite-plugin-svgr';
|
||||
import vitePluginForArco from '@arco-plugins/vite-react';
|
||||
import setting from './src/settings.json';
|
||||
import { createHtmlPlugin } from "vite-plugin-html";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({mode})=>{
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
return {
|
||||
server:{
|
||||
port:9000,
|
||||
proxy:{
|
||||
'^/api': {
|
||||
target: env.VITE_APP_BASE_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
}
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: [{ find: '@', replacement: '/src' }],
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
svgrPlugin({
|
||||
svgrOptions: {},
|
||||
}),
|
||||
vitePluginForArco({
|
||||
theme: '@arco-themes/react-arco-pro',
|
||||
modifyVars: {
|
||||
'arcoblue-6': setting.themeColor,
|
||||
},
|
||||
}),
|
||||
createHtmlPlugin({
|
||||
inject: {
|
||||
data: {
|
||||
title: env.VITE_APP_TITLE,
|
||||
},
|
||||
},
|
||||
})
|
||||
],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user