mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 22:57:15 +08:00 
			
		
		
		
	chore: 优化开发者工具配置
This commit is contained in:
		
							
								
								
									
										6
									
								
								config/plugins/devtools.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								config/plugins/devtools.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| import VueDevTools from 'vite-plugin-vue-devtools' | ||||
|  | ||||
| export default function createDevtools(env) { | ||||
|   const { VITE_OPEN_DEVTOOLS } = env | ||||
|   return VITE_OPEN_DEVTOOLS === 'true' && VueDevTools() | ||||
| } | ||||
| @@ -2,13 +2,15 @@ import type { PluginOption } from 'vite' | ||||
| import vue from '@vitejs/plugin-vue' | ||||
| import vueJsx from '@vitejs/plugin-vue-jsx' | ||||
|  | ||||
| import createDevtools from './devtools' | ||||
| import createAutoImport from './auto-import' | ||||
| import createComponents from './components' | ||||
| import createSvgIcon from './svg-icon' | ||||
| import createMock from './mock' | ||||
| import VueDevTools from 'vite-plugin-vue-devtools' | ||||
|  | ||||
| export default function createVitePlugins(viteEnv, isBuild = false) { | ||||
|   const vitePlugins: (PluginOption | PluginOption[])[] = [vue(), vueJsx(), VueDevTools()] | ||||
|   const vitePlugins: (PluginOption | PluginOption[])[] = [vue(), vueJsx()] | ||||
|   vitePlugins.push(createDevtools(viteEnv)) | ||||
|   vitePlugins.push(createAutoImport()) | ||||
|   vitePlugins.push(createComponents()) | ||||
|   vitePlugins.push(createSvgIcon(isBuild)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user