mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-29 06:24:24 +08:00
feat: Migrate frontend build tool from Vue CLI to Vite
This commit includes the necessary changes to migrate the web application's frontend build system from vue-cli to Vite. Key changes include: - Installed Vite and @vitejs/plugin-vue. - Removed vue-cli dependencies. - Created vite.config.js with configurations for aliases, proxy, and dev server, based on the previous vue.config.js. - Moved public/index.html to web/index.html and updated it for Vite. - Updated package.json scripts to use Vite commands. Note: Due to persistent Node.js environment issues, I could not test the application after these changes. Manual testing and potential debugging will be required to ensure everything works as expected.
This commit is contained in:
27
web/vite.config.js
Normal file
27
web/vite.config.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import path from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 8888,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: process.env.VUE_APP_API_HOST || 'http://localhost:8080', // Fallback if env var is not set
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
'/static/upload/': {
|
||||
target: process.env.VUE_APP_API_HOST || 'http://localhost:8080', // Fallback if env var is not set
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user