29 lines
667 B
JavaScript
29 lines
667 B
JavaScript
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import jsconfigPaths from 'vite-jsconfig-paths';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
const APP_BASE_URL = `${env.VITE_APP_BASE_URL}`;
|
|
const PORT = 3000;
|
|
|
|
return {
|
|
server: {
|
|
// this ensures that the browser opens upon server start
|
|
open: true,
|
|
// this sets a default port to 3000
|
|
port: PORT,
|
|
host: true
|
|
},
|
|
preview: {
|
|
open: true,
|
|
host: true
|
|
},
|
|
define: {
|
|
global: 'window'
|
|
},
|
|
base: APP_BASE_URL,
|
|
plugins: [react(), jsconfigPaths()]
|
|
};
|
|
});
|