|
12345678910111213141516171819202122232425262728293031323334353637 |
- 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,
- }
- }
- }
|