修复 vite.config.ts 的警告
This commit is contained in:
parent
8f87746359
commit
64766795bb
|
@ -1,9 +1,9 @@
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { defineConfig, loadEnv } from 'vite'
|
import { ConfigEnv, defineConfig, loadEnv, ServerOptions, UserConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||||
import { viteMockServe } from 'vite-plugin-mock'
|
import { ViteMockOptions, viteMockServe } from 'vite-plugin-mock'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import UnoCSS from 'unocss/vite'
|
import UnoCSS from 'unocss/vite'
|
||||||
import { presetAttributify, presetIcons, presetUno } from 'unocss'
|
import { presetAttributify, presetIcons, presetUno } from 'unocss'
|
||||||
|
@ -16,7 +16,7 @@ import vitePluginSetupExtend from './src/plugins/vite-plugin-setup-extend'
|
||||||
import vitePluginVueSetupExtend from 'vite-plugin-vue-setup-extend'
|
import vitePluginVueSetupExtend from 'vite-plugin-vue-setup-extend'
|
||||||
// import { visualizer } from 'rollup-plugin-visualizer'
|
// import { visualizer } from 'rollup-plugin-visualizer'
|
||||||
const pathSrc = resolve(__dirname, 'src')
|
const pathSrc = resolve(__dirname, 'src')
|
||||||
export default defineConfig(({ command, mode }) => {
|
export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
//const env = loadEnv(mode, process.cwd(), '') //获取环境变量
|
//const env = loadEnv(mode, process.cwd(), '') //获取环境变量
|
||||||
return {
|
return {
|
||||||
base: setting.viteBasePath,
|
base: setting.viteBasePath,
|
||||||
|
@ -31,6 +31,7 @@ export default defineConfig(({ command, mode }) => {
|
||||||
port: 5005, // 类型: number 指定服务器端口;
|
port: 5005, // 类型: number 指定服务器端口;
|
||||||
open: false, // 类型: boolean | string在服务器启动时自动在浏览器中打开应用程序;
|
open: false, // 类型: boolean | string在服务器启动时自动在浏览器中打开应用程序;
|
||||||
host: true,
|
host: true,
|
||||||
|
// @ts-ignore
|
||||||
https: false
|
https: false
|
||||||
},
|
},
|
||||||
preview: {
|
preview: {
|
||||||
|
@ -65,7 +66,7 @@ export default defineConfig(({ command, mode }) => {
|
||||||
setupProdMockServer();
|
setupProdMockServer();
|
||||||
`,
|
`,
|
||||||
logger: true
|
logger: true
|
||||||
}),
|
} as ViteMockOptions),
|
||||||
// VueSetupExtend(),using DefineOptions instant of it
|
// VueSetupExtend(),using DefineOptions instant of it
|
||||||
//https://github.com/antfu/unplugin-auto-import/blob/HEAD/src/types.ts
|
//https://github.com/antfu/unplugin-auto-import/blob/HEAD/src/types.ts
|
||||||
Components({
|
Components({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user