11import type { PluginOption } from 'vite'
22import process from 'node:process'
33import { FantasticAutoImports , FantasticComponentsResolver , FantasticComponentsType } from '@fantastic-mobile/components/resolver'
4+ import { createFantasticMobileCopyrightPlugins } from '@fantastic-mobile/copyright'
45import VitePluginSvgSpritemap from '@spiriit/vite-plugin-svg-spritemap'
56import vueLegacy from '@vitejs/plugin-legacy'
67import vue from '@vitejs/plugin-vue'
78import vueJsx from '@vitejs/plugin-vue-jsx'
8- import boxen from 'boxen'
9- import picocolors from 'picocolors'
109import Unocss from 'unocss/vite'
1110import autoImport from 'unplugin-auto-import/vite'
1211import TurboConsole from 'unplugin-turbo-console/vite'
1312import components from 'unplugin-vue-components/vite'
1413import { loadEnv } from 'vite'
1514import Archiver from 'vite-plugin-archiver'
16- import banner from 'vite-plugin-banner'
1715import { compression } from 'vite-plugin-compression2'
1816import { envParse , parseLoadedEnv } from 'vite-plugin-env-parse'
1917import { vitePluginFakeServer } from 'vite-plugin-fake-server'
@@ -109,15 +107,7 @@ export default function createVitePlugins(mode: string, isBuild = false) {
109107
110108 // https://github.com/unplugin/unplugin-turbo-console
111109 TurboConsole ( ) ,
112-
113- // https://github.com/chengpeiquan/vite-plugin-banner
114- banner ( `
115- /**
116- * 由 Fantastic-mobile 提供技术支持
117- * Powered by Fantastic-mobile
118- * https://fantastic-mobile.hurui.me/
119- */
120- ` ) ,
110+ createFantasticMobileCopyrightPlugins ( ) ,
121111
122112 {
123113 name : 'vite-plugin-debug-plugin' ,
@@ -144,26 +134,6 @@ new VConsole()
144134 }
145135 } ,
146136 } ,
147-
148- {
149- name : 'appInfo' ,
150- apply : 'serve' ,
151- async buildStart ( ) {
152- const { bold, green, cyan, bgGreen, underline } = picocolors
153- // eslint-disable-next-line no-console
154- console . log (
155- boxen (
156- `${ bold ( green ( `由 ${ bgGreen ( 'Fantastic-mobile' ) } 驱动` ) ) } \n\n${ underline ( 'https://fantastic-mobile.hurui.me' ) } \n\n当前使用:${ cyan ( '基础版' ) } ` ,
157- {
158- padding : 1 ,
159- margin : 1 ,
160- borderStyle : 'double' ,
161- textAlignment : 'center' ,
162- } ,
163- ) ,
164- )
165- } ,
166- } ,
167137 ]
168138 return vitePlugins
169139}
0 commit comments