12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import {defineConfig, loadEnv} from 'vite'
- import vue from '@vitejs/plugin-vue'
- import legacy from '@vitejs/plugin-legacy'
- import VueSetupExtend from 'vite-plugin-vue-setup-extend'
- import AutoImport from 'unplugin-auto-import/vite';
- import { injectHtml } from "vite-plugin-html";
- const {resolve} = require('path')
- export default defineConfig(mode => {
- const env = loadEnv(mode.mode, process.cwd());
- return {
-
- base: env.VITE_PUBLIC_PATH,
-
- server: {
- proxy: {}
- },
-
- plugins: [
- vue(),
- legacy({
- targets: ['defaults', 'not IE 11']
- }),
-
- VueSetupExtend(),
-
- AutoImport({
- imports: ['vue', 'vue-router'],
- }),
-
- injectHtml({
- data: {
- title: env.VITE_ADMIN_TITLE
- }
- }),
- ],
- resolve: {
-
- alias: {
- '@': resolve(__dirname, '.', './src/'),
- '/@': resolve(__dirname, '.', './src/'),
- },
-
- extensions: ['.vue', '.js', '.json', '.css']
- },
- build: {
- outDir: 'production'
- },
- }
- })
|