1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const { resolve } = require('path')
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- import { VitePWA } from 'vite-plugin-pwa'
- const vueJsx = require('@vitejs/plugin-vue-jsx')
- const legacy = require('@vitejs/plugin-legacy')
- const proxyUrl = "https://test.dayaedu.com/"; // test 环境
- // https://vitejs.dev/config/
- export default defineConfig({
- base: "./",
- // '/src': resolve(__dirname, './src')
- resolve: {
- alias: {
- '@': resolve(__dirname, './src')
- }
- },
- plugins: [
- vue(),
- vueJsx(),
- legacy({
- targets: ["> 0.25%, not dead"],
- ignoreBrowserslistConfig: true,
- }),
- VitePWA({
- injectRegister: "auto",
- workbox: {
- cleanupOutdatedCaches: true
- },
- base: './',
- manifest: {
- name: '管乐迷',
- short_name: '管乐迷',
- theme_color: '#01C1B5',
- icons: [
- {
- src: './pwa-192x192.png',
- sizes: '192x192',
- type: 'image/png',
- },
- {
- src: './pwa-512x512.png',
- sizes: '512x512',
- type: 'image/png',
- },
- ],
- },
- })
- ],
- server: {
- cors: true,
- proxy: {
- '/api-web': {
- target: proxyUrl,
- changeOrigin: true
- }
- }
- }
- });
|