|
- import type { UserConfig, ConfigEnv } from 'vite';
- import { loadEnv } from 'vite';
- import { wrapperEnv } from './build/utils';
- import react from '@vitejs/plugin-react';
- import WindiCSS from 'vite-plugin-windicss';
-
- // https://vitejs.dev/config/
- export default ({ command, mode }: ConfigEnv): UserConfig => {
-
- const root = process.cwd();
- const env = loadEnv(mode, root);
- const viteEnv = wrapperEnv(env);
- const { VITE_PORT } = viteEnv;
-
- return {
- base: '/',
- plugins: [
- react(),
- WindiCSS()
- ],
- resolve: {
- alias: {
- '@/': '/src/',
- '/#/': '/types/'
- },
- },
- server: {
- https: true,
- host: true,
- port: VITE_PORT,
- },
- build: {
- manifest: true,
- sourcemap: true,
- }
- }
- }
|