123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import { defineConfig } from 'vite';
- import vue from '@vitejs/plugin-vue';
- import styleImport from 'vite-plugin-style-import';
- const vueJsx = require('@vitejs/plugin-vue-jsx');
- const legacy = require('@vitejs/plugin-legacy');
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- const path = require('path');
- function resolve(dir: string) {
- return path.join(__dirname, dir);
- }
- // https://vitejs.dev/config/
- // https://github.com/vitejs/vite/issues/1930 .env
- export default defineConfig({
- plugins: [
- vue(),
- vueJsx(),
- legacy({
- targets: ['> 0.25%, not dead'],
- ignoreBrowserslistConfig: true
- }),
- styleImport({
- libs: [
- {
- libraryName: 'vant',
- esModule: true,
- resolveStyle: name => `vant/es/${name}/style`
- }
- ]
- })
- ],
- resolve: {
- alias: {
- '@': resolve('./src'),
- '@common': resolve('./src/common'),
- '@components': resolve('./src/components'),
- '@store': resolve('./src/store'),
- '@views': resolve('./src/views')
- }
- },
- server: {
- host: '0.0.0.0',
- port: 5000,
- strictPort: true
- },
- build: {
- rollupOptions: {
- input: {
- index: path.resolve(__dirname, 'index.html'),
- about: path.resolve(__dirname, 'teacher.html')
- }
- }
- }
- });
|