1234567891011121314151617181920212223242526272829303132333435363738 |
- import {defineConfig} from 'vite'
- import {createVuePlugin} from 'vite-plugin-vue2'
- import {resolve} from 'path'
- import WindiCss from 'vite-plugin-windicss';
- // https://vitejs.dev/config/
- export default defineConfig(({command}) => {
- const config = {
- plugins: [
- createVuePlugin({
- jsx: true,
- }),
- WindiCss()
- ],
- server: {
- port: 3001,
- },
- build: {
- target: 'esnext'
- },
- resolve: {
- alias: {
- '~': resolve(__dirname, 'src'),
- '@': resolve(__dirname, 'src'),
- '@c': resolve(__dirname, 'src/components'),
- },
- },
- css: {}
- }
- if (command === 'build') {
- config.base = ''
- } else {
- config.base = '/'
- }
- return config
- })
|