123456789101112131415161718192021222324252627282930313233 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import styleImport, { VantResolve } from 'vite-plugin-style-import'
- import WindiCSS from 'vite-plugin-windicss'
- import * as path from 'path'
- // https://vitejs.dev/config/
- export default defineConfig({
- server: {
- host: true
- },
- plugins: [
- vue(),
- WindiCSS(),
- styleImport({
- resolves: [VantResolve()]
- })
- ],
- resolve: {
- alias: {
- '@': path.resolve(__dirname, 'src'), //使用@来代表src目录
- components: path.resolve(__dirname, 'src/components'),
- styles: path.resolve(__dirname, 'src/styles'),
- plugins: path.resolve(__dirname, 'src/plugins'),
- views: path.resolve(__dirname, 'src/views'),
- layouts: path.resolve(__dirname, 'src/layouts'),
- utils: path.resolve(__dirname, 'src/utils'),
- apis: path.resolve(__dirname, 'src/apis'),
- dirs: path.resolve(__dirname, 'src/directives')
- }
- }
- })
|