vue3-vant-mobile/vite.config.ts

58 lines
1.2 KiB
TypeScript
Raw Normal View History

import path from 'node:path'
2023-12-27 06:21:13 +00:00
import process from 'node:process'
2022-10-22 12:51:16 +00:00
import { loadEnv } from 'vite'
import type { ConfigEnv, UserConfig } from 'vite'
import viewport from 'postcss-mobile-forever'
import autoprefixer from 'autoprefixer'
import { createVitePlugins } from './build/vite'
export default ({ mode }: ConfigEnv): UserConfig => {
2022-10-22 12:51:16 +00:00
const root = process.cwd()
const env = loadEnv(mode, root)
2022-06-04 07:07:46 +00:00
return {
base: env.VITE_APP_PUBLIC_PATH,
plugins: createVitePlugins(),
server: {
host: true,
port: 3000,
proxy: {
'/api': {
target: '',
ws: false,
changeOrigin: true,
},
},
},
2024-02-04 15:45:43 +00:00
resolve: {
alias: {
'~@': path.join(__dirname, './src'),
'@': path.join(__dirname, './src'),
'~': path.join(__dirname, './src/assets'),
},
},
2022-06-23 07:43:05 +00:00
css: {
postcss: {
plugins: [
autoprefixer(),
viewport({
appSelector: '#app',
viewportWidth: 375,
maxDisplayWidth: 600,
2024-04-01 15:04:50 +00:00
appContainingBlock: 'auto',
necessarySelectorWhenAuto: '.app-wrapper',
}),
],
},
},
2022-06-23 07:43:05 +00:00
build: {
cssCodeSplit: false,
chunkSizeWarningLimit: 2048,
2022-06-23 07:43:05 +00:00
},
2022-10-22 12:51:16 +00:00
}
}