Created
November 30, 2022 02:28
-
-
Save khanhkhuu/5dcaad8dae66ad4a99538b0d0fe3e32a to your computer and use it in GitHub Desktop.
Vite config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig, loadEnv } from "vite"; | |
import vue from "@vitejs/plugin-vue"; | |
import { quasar, transformAssetUrls } from "@quasar/vite-plugin"; | |
import path from "path"; | |
import { name } from './package.json'; | |
// https://vitejs.dev/config/ | |
export default defineConfig(({ mode }) => { | |
const ENV = loadEnv(mode, process.cwd()); | |
return { | |
plugins: [ | |
vue({ | |
template: { transformAssetUrls }, | |
}), | |
quasar(), | |
], | |
resolve: { | |
alias: { | |
"@": path.resolve(__dirname, "./src"), | |
}, | |
}, | |
server: { | |
host: "0.0.0.0", | |
port: 8080, | |
strictPort: true, | |
proxy: { | |
'/api': { | |
target: 'https://localhost', | |
changeOrigin: true, | |
secure: false, | |
}, | |
'/gauth': { | |
target: 'https://localhost', | |
changeOrigin: true, | |
secure: false, | |
}, | |
'/hub': { | |
target: 'wss://localhost', | |
changeOrigin: true, | |
secure: false, | |
} | |
} | |
}, | |
base: ENV.VITE_BASE_URL, | |
build: { | |
emptyOutDir: true, | |
outDir: "../../dist/" + name, | |
}, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment