@gsc-basic/vite-config 1.1.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +147 -148
  2. package/dist/index.js +4 -12
  3. package/package.json +11 -13
package/dist/index.d.ts CHANGED
@@ -1,179 +1,178 @@
1
- import * as vite from 'vite';
2
- import { ConfigEnv, UserConfig, PluginOption } from 'vite';
3
- import { PluginOptions } from '@intlify/unplugin-vue-i18n';
4
1
 
2
+ import { ConfigEnv, PluginOption, UserConfig } from "vite";
3
+ import { PluginOptions } from "@intlify/unplugin-vue-i18n";
4
+
5
+ //#region src/typing.d.ts
5
6
  interface CompressOptions {
6
- compressList?: Array<'gzip' | 'brotliCompress'>;
7
- tarballResult?: boolean;
8
- deleteOriginalAssets?: boolean;
7
+ compressList?: Array<'gzip' | 'brotliCompress'>;
8
+ tarballResult?: boolean;
9
+ deleteOriginalAssets?: boolean;
9
10
  }
10
11
  interface SvgIconOptions {
11
- iconDir?: string;
12
- preserveColorDir?: string;
13
- componentName?: string;
12
+ iconDir?: string;
13
+ preserveColorDir?: string;
14
+ componentName?: string;
14
15
  }
15
16
  /**
16
17
  * 通用插件配置选项
17
18
  * @description 所有插件共用的基础配置
18
19
  */
19
20
  interface CommonPluginOptions {
20
- /**
21
- * 是否为构建模式
22
- */
23
- isBuild?: boolean;
24
- /**
25
- * 是否开启开发工具
26
- * @default false
27
- */
28
- devtools?: boolean;
29
- /**
30
- * 环境变量
31
- * @description 自定义环境变量
32
- */
33
- env?: Record<string, any>;
34
- /**
35
- * 是否注入元数据
36
- * @default true
37
- */
38
- injectMetadata?: boolean;
39
- /**
40
- * 是否开启依赖分析
41
- * @default false
42
- * @description 使用 vite-bundle-analyzer 分析依赖
43
- */
44
- analyzer?: boolean;
45
- /**
46
- * 是否开启UnoCSS支持
47
- * @default true
48
- */
49
- unocss?: boolean;
50
- /**
51
- * 是否开启 Vue Router 自动路由支持
52
- * @default false
53
- */
54
- vueRouter?: boolean;
55
- vueRouterOptions?: Record<string, any>;
56
- /**
57
- * 图标自动安装选项
58
- * @description 配置图标自动安装功能
59
- * @default true
60
- */
61
- iconify?: boolean;
62
- /**
63
- * 是否开启 SVG 图标支持
64
- * @default true
65
- */
66
- svgIcon?: boolean;
67
- svgIconOptions?: SvgIconOptions;
68
- /**
69
- * 是否开启压缩
70
- * @default false
71
- * @description 支持 gzip 和 brotli 压缩
72
- */
73
- compress?: boolean;
74
- /**
75
- * 压缩类型
76
- * @default ['gzip']
77
- * @description 可选的压缩类型
78
- */
79
- compressOptions?: CompressOptions;
80
- /**
81
- * 是否开启 HTML 插件
82
- * @default true
83
- */
84
- html?: boolean;
85
- /**
86
- * 是否开启国际化
87
- * @default true
88
- */
89
- i18n?: boolean;
90
- i18nOptions?: PluginOptions;
91
- /**
92
- * 是否注入版权信息
93
- * @default true
94
- */
95
- license?: boolean;
96
- /**
97
- * 是否开启 legacy 支持
98
- * @default true
99
- */
100
- legacy?: boolean;
101
- /**
102
- * 是否显示更新通知
103
- * @default true
104
- */
105
- updateNotice?: boolean;
106
- /**
107
- * 是否生成二维码
108
- * @default false
109
- */
110
- qrcode?: boolean;
111
- /**
112
- * 是否开启模拟数据
113
- * @default true
114
- */
115
- mock?: boolean;
116
- /**
117
- * 是否开启 Turbo Console
118
- * @default true
119
- */
120
- turboConsole?: boolean;
21
+ /**
22
+ * 是否为构建模式
23
+ */
24
+ isBuild?: boolean;
25
+ /**
26
+ * 是否开启开发工具
27
+ * @default false
28
+ */
29
+ devtools?: boolean;
30
+ /**
31
+ * 环境变量
32
+ * @description 自定义环境变量
33
+ */
34
+ env?: Record<string, any>;
35
+ /**
36
+ * 是否注入元数据
37
+ * @default true
38
+ */
39
+ injectMetadata?: boolean;
40
+ /**
41
+ * 是否开启依赖分析
42
+ * @default false
43
+ * @description 使用 vite-bundle-analyzer 分析依赖
44
+ */
45
+ analyzer?: boolean;
46
+ /**
47
+ * 是否开启UnoCSS支持
48
+ * @default true
49
+ */
50
+ unocss?: boolean;
51
+ /**
52
+ * 是否开启 Vue Router 自动路由支持
53
+ * @default false
54
+ */
55
+ vueRouter?: boolean;
56
+ vueRouterOptions?: Record<string, any>;
57
+ /**
58
+ * 图标自动安装选项
59
+ * @description 配置图标自动安装功能
60
+ * @default true
61
+ */
62
+ iconify?: boolean;
63
+ /**
64
+ * 是否开启 SVG 图标支持
65
+ * @default true
66
+ */
67
+ svgIcon?: boolean;
68
+ svgIconOptions?: SvgIconOptions;
69
+ /**
70
+ * 是否开启压缩
71
+ * @default false
72
+ * @description 支持 gzip 和 brotli 压缩
73
+ */
74
+ compress?: boolean;
75
+ /**
76
+ * 压缩类型
77
+ * @default ['gzip']
78
+ * @description 可选的压缩类型
79
+ */
80
+ compressOptions?: CompressOptions;
81
+ /**
82
+ * 是否开启 HTML 插件
83
+ * @default true
84
+ */
85
+ html?: boolean;
86
+ /**
87
+ * 是否开启国际化
88
+ * @default true
89
+ */
90
+ i18n?: boolean;
91
+ i18nOptions?: PluginOptions;
92
+ /**
93
+ * 是否注入版权信息
94
+ * @default true
95
+ */
96
+ license?: boolean;
97
+ /**
98
+ * 是否开启 legacy 支持
99
+ * @default true
100
+ */
101
+ legacy?: boolean;
102
+ /**
103
+ * 是否显示更新通知
104
+ * @default true
105
+ */
106
+ updateNotice?: boolean;
107
+ /**
108
+ * 是否开启模拟数据
109
+ * @default true
110
+ */
111
+ mock?: boolean;
112
+ /**
113
+ * 是否开启 Turbo Console
114
+ * @default true
115
+ */
116
+ turboConsole?: boolean;
121
117
  }
122
118
  interface ProxySettingItem {
123
- prefix: string;
124
- target: string;
125
- rewrite?: boolean;
119
+ prefix: string;
120
+ target: string;
121
+ rewrite?: boolean;
126
122
  }
127
123
  /**
128
124
  * 应用配置选项类型
129
125
  */
130
126
  interface ApplicationOptions extends CommonPluginOptions {
131
- appInfo: Record<string, any>;
132
- base?: string;
133
- serverPort?: number;
134
- openPage?: boolean;
135
- showProxyLog?: boolean;
136
- proxyConfig?: ProxySettingItem[];
137
- showPreviewProxyLog?: boolean;
138
- previewProxyConfig?: ProxySettingItem[];
139
- lessModifyVars?: Record<string, string>;
140
- themeToken?: Record<string, string>;
141
- prefixClass?: string;
142
- appTitle?: string;
127
+ appInfo: Record<string, any>;
128
+ base?: string;
129
+ serverPort?: number;
130
+ openPage?: boolean;
131
+ showProxyLog?: boolean;
132
+ proxyConfig?: ProxySettingItem[];
133
+ showPreviewProxyLog?: boolean;
134
+ previewProxyConfig?: ProxySettingItem[];
135
+ lessModifyVars?: Record<string, string>;
136
+ themeToken?: Record<string, string>;
137
+ prefixClass?: string;
138
+ appTitle?: string;
143
139
  }
144
140
  /**
145
141
  * 应用配置定义函数类型(默认暂不支持library模式)
146
142
  * @description 用于定义应用构建配置
147
143
  */
148
144
  type DefineConfig = (config?: ConfigEnv) => Promise<{
149
- /** 应用插件配置 */
150
- application?: ApplicationOptions;
151
- /** Vite 配置 */
152
- vite?: UserConfig;
145
+ /** 应用插件配置 */application?: ApplicationOptions; /** Vite 配置 */
146
+ vite?: UserConfig;
153
147
  }>;
154
-
148
+ //#endregion
149
+ //#region src/plugins/index.d.ts
155
150
  declare function createVitePlugins(options: ApplicationOptions): Promise<PluginOption[]>;
156
-
157
- declare function defineConfig(config?: DefineConfig): vite.UserConfigFnPromise;
158
-
159
- declare function generateProjectInfo({ pkg }?: {
160
- pkg?: Record<string, string>;
151
+ //#endregion
152
+ //#region src/config/index.d.ts
153
+ declare function defineConfig(config?: DefineConfig): any;
154
+ //#endregion
155
+ //#region src/utils/index.d.ts
156
+ declare function generateProjectInfo({
157
+ pkg
158
+ }?: {
159
+ pkg?: Record<string, string>;
161
160
  }): string;
162
161
  interface ProxyItem {
163
- prefix: string;
164
- target: string;
165
- rewrite?: boolean;
162
+ prefix: string;
163
+ target: string;
164
+ rewrite?: boolean;
166
165
  }
167
166
  interface ProxyOptions {
168
- [prefix: string]: {
169
- target: string;
170
- changeOrigin: boolean;
171
- ws: boolean;
172
- rewrite: (path: string) => string;
173
- secure?: boolean;
174
- configure?: (proxy: any) => void;
175
- };
167
+ [prefix: string]: {
168
+ target: string;
169
+ changeOrigin: boolean;
170
+ ws: boolean;
171
+ rewrite: (path: string) => string;
172
+ secure?: boolean;
173
+ configure?: (proxy: any) => void;
174
+ };
176
175
  }
177
176
  declare function createProxy(list: ProxyItem[], showProxyLog?: boolean): ProxyOptions;
178
-
179
- export { type ApplicationOptions, type CommonPluginOptions, type CompressOptions, type DefineConfig, type ProxyItem, type ProxyOptions, type ProxySettingItem, type SvgIconOptions, createProxy, createVitePlugins, defineConfig, generateProjectInfo };
177
+ //#endregion
178
+ export { type ApplicationOptions, type CommonPluginOptions, type CompressOptions, type DefineConfig, type ProxyItem, type ProxyOptions, type ProxySettingItem, type SvgIconOptions, createProxy, createVitePlugins, defineConfig, generateProjectInfo };
package/dist/index.js CHANGED
@@ -7,16 +7,8 @@ You shall not disclose such Confidential Information and shall use it only in
7
7
  accordance with the terms of the license agreement.
8
8
 
9
9
  --- Build Info ---
10
- Version: 1.1.2
11
- Build Time: 2026/3/3 17:22:47
12
- Build Commit: a388255c630130f5e69ede988a8585cdbdc065c1
10
+ Version: 1.1.3
11
+ Build Time: 2026/3/30 18:11:46
12
+ Build Commit: 0e77bf611239cf191125d0cf6cd783dd9e9fff9b
13
13
  */
14
- import $ from"@vitejs/plugin-vue";import k from"@vitejs/plugin-vue-jsx";import L from"@vitejs/plugin-legacy";import N from"@intlify/unplugin-vue-i18n/vite";import R from"vite-plugin-banner";import{qrcode as z}from"vite-plugin-qrcode";import{mockDevServerPlugin as E}from"vite-plugin-mock-dev-server";import V from"unplugin-info/vite";import _ from"unplugin-turbo-console/vite";import U from"vite-plugin-vue-devtools";import j from"unplugin-icons/vite";function u(e="GSC Scaffolding",r){return{name:"html-injection",transformIndexHtml(t){let i=`${r.lastBuildTime}(v${r.pkg.version})`;return t.replace("</head>",`<title>${e}</title>
15
- <meta name="revised" content="${i}" />
16
- <script>window.${r.DEPLOY_ENV_VAR_NAME} = "@DEPLOY__ENV";</script>
17
- </head>`)}}}import{compression as b,tarball as I}from"vite-plugin-compression2";function f(e){let{compressList:r=[],tarballResult:t=!1,deleteOriginalAssets:i=!1}=e,n=[];return r.length>0&&n.push(b({algorithms:r,deleteOriginalAssets:i,skipIfLargerOrEqual:!1,exclude:[/\.(br)$/,/\.(gz)$/]})),t&&n.length>0&&n.push(I()),n}import m from"path";import w from"unplugin-svg-component/vite";function g({prefixClass:e="lenovo",iconDir:r="src/assets/icons",componentName:t="SvgIcon",preserveColorDir:i}){let n={treeShaking:!1};return i&&(n.preserveColor=m.resolve(process.cwd(),i)),w({iconDir:[m.resolve(process.cwd(),r)],projectType:"vue",vueVersion:3,dts:!1,componentName:t,prefix:void 0,symbolIdFormatter:(o,s)=>{let p=o.split("/");return s&&p.unshift(s),p.join("-").replace(/\.svg$/,"")},componentStyle:"width: 1em;height: 1em;fill: currentColor;vertical-align: -0.125em;",svgSpriteDomId:`${e}-svg-dom`,domInsertionStrategy:"dynamic",...n})}import{analyzer as S}from"vite-bundle-analyzer";function d(e="",r=8080){return S({reportTitle:`${e} Analyzer`,analyzerMode:"server",analyzerPort:r+200,openAnalyzer:!0})}import{webUpdateNotice as A}from"@plugin-web-update-notification/vite";function y({base:e,primaryColor:r}){return A({checkInterval:1800*1e3,checkOnWindowFocus:!0,checkImmediately:!1,checkOnLoadFileError:!0,hiddenDefaultNotification:!1,logVersion:!1,notificationConfig:{primaryColor:r},injectFileBase:e??"/"})}import v from"ansis";import{regexpMap as D}from"@gsc-basic/utils";function h({pkg:e}={}){return`/**
18
- * name: ${e?.name}
19
- * version: v${e?.version}
20
- * author: ${typeof e?.author=="string"?e.author:e?.author&&e.author.name||""}
21
- * build time: ${new Date().toLocaleString()}
22
- */`}function l(e,r=!1){let t={};for(let i of e){let{prefix:n,target:o,rewrite:s}=i;typeof s>"u"&&(s=!0);let p=D.httpsUrl.test(o);t[n]={target:o,changeOrigin:!0,ws:!0,rewrite:a=>s?a.replace(new RegExp(`^${n}`),""):a,...p?{secure:!1}:{},...r?{configure:a=>{a.on("proxyRes",(C,c)=>{console.log("proxy: ",v.red(c.originalUrl)," ===> ",v.green(C.client.servername+c.url))})}}:{}}}return t}function T(e,r){return Math.floor(Math.random()*(r-e+1))+e}function P(e){return import(e)}async function O(e){let r=[$({template:{compilerOptions:{isCustomElement:t=>t.startsWith("micro-app")}}}),k()];if(e.vueRouter)try{let{default:t}=await P("vue-router/vite");r.unshift(t(e.vueRouterOptions||{}))}catch(t){console.warn("[vite-config] `vueRouter` is enabled but `vue-router 5.x` is not installed, skip VueRouter plugin.",t)}if(e.unocss)try{let{default:t}=await P("unocss/vite");r.push(t({mode:"global"}))}catch(t){console.warn("[vite-config] `unocss` is enabled but `unocss` is not installed, skip UnoCSS plugin.",t)}if(e.iconify&&r.push(j({compiler:"vue3",autoInstall:!0})),e.injectMetadata&&r.push(V({meta:{themeToken:e.themeToken,appInfo:e.appInfo},package:{dependencies:!0,devDependencies:!0}})),e.i18n&&r.push(N({fullInstall:!0,runtimeOnly:!0,...e.i18nOptions||{}})),e.isBuild?(e.legacy&&r.push(L({targets:["> 0.2%","not dead","not op_mini all"]})),e.compress&&r.push(...f(e.compressOptions||{})),e.license&&r.push(R(h(e.appInfo))),e.updateNotice&&r.push(y({base:e.base,primaryColor:e.themeToken?.colorPrimary}))):(e.turboConsole&&r.push(_({server:{port:(e.serverPort??8080)+T(100,1e3)},launchEditor:!0})),e.devtools&&r.push(U({launchEditor:"code"})),e.qrcode&&r.push(z())),e.svgIcon){let t=e.svgIconOptions??{};r.push(g({prefixClass:e.prefixClass,iconDir:t.iconDir,preserveColorDir:t.preserveColorDir}))}return e.html&&r.push(u(e.appTitle,e.appInfo)),e.mock&&r.push(E({})),e.analyzer&&r.push(d(e.appTitle,e.serverPort)),r}import{resolve as M}from"path";import{defineConfig as F,mergeConfig as B}from"vite";import H from"autoprefixer";function q(e){return M(process.cwd(),".",e)}function x(e){return F(async r=>{let{command:t}=r,i=await e?.(r),o={...{appInfo:{},devtools:!1,injectMetadata:!0,analyzer:!1,unocss:!0,iconify:!0,svgIcon:!0,html:!0,i18n:!0,license:!0,legacy:!0,updateNotice:!0,qrcode:!1,mock:!0,turboConsole:!0},...i?.application||{}},s=t==="build",p={base:o.base??"/",root:process.cwd(),logLevel:"info",resolve:{alias:[{find:/@\//,replacement:`${q("src")}/`}]},server:{host:!0,port:o.serverPort??8080,open:o.openPage??!0,hmr:!0,proxy:l(o.proxyConfig||[],o.showProxyLog??!1),headers:{"Access-Control-Allow-Origin":"*"}},preview:{port:(o.serverPort??8080)+100,proxy:l(o.previewProxyConfig||[],o.showPreviewProxyLog??!1)},esbuild:{charset:"ascii"},build:{outDir:"dist",minify:"esbuild",reportCompressedSize:!1,chunkSizeWarningLimit:5e3,assetsInlineLimit:1024},define:{__APP_INFO__:JSON.stringify(o.appInfo??{}),"import.meta.vitest":"undefined"},css:{preprocessorOptions:{less:{modifyVars:o.lessModifyVars||{},javascriptEnabled:!0}},postcss:{plugins:s?[H()]:[]}},plugins:await O({...o,isBuild:s})};return B(p,i?.vite||{})})}function ke(e){return x(e)}export{l as createProxy,O as createVitePlugins,ke as defineConfig,h as generateProjectInfo};
14
+ import e from"@vitejs/plugin-vue";import t from"@vitejs/plugin-vue-jsx";import n from"@vitejs/plugin-legacy";import r from"@intlify/unplugin-vue-i18n/vite";import{mockDevServerPlugin as i}from"vite-plugin-mock-dev-server";import a from"unplugin-info/vite";import o from"unplugin-turbo-console/vite";import s from"vite-plugin-vue-devtools";import c from"unplugin-icons/vite";import{compression as l,tarball as u}from"vite-plugin-compression2";import d,{resolve as f}from"node:path";import p from"unplugin-svg-component/vite";import{analyzer as m}from"vite-bundle-analyzer";import{webUpdateNotice as h}from"@plugin-web-update-notification/vite";import{defineConfig as g,mergeConfig as _}from"vite";import v from"autoprefixer";import y from"ansis";import{regexpMap as b}from"@gsc-basic/utils";function x(e=`GSC Scaffolding`,t){return{name:`html-injection`,transformIndexHtml(n){let r=`${t.lastBuildTime}(v${t.pkg.version})`;return n.replace(`</head>`,`<title>${e}</title>\n<meta name="revised" content="${r}" />\n<script>window.${t.DEPLOY_ENV_VAR_NAME} = "@DEPLOY__ENV";<\/script>\n</head>`)}}}function S(e){let{compressList:t=[],tarballResult:n=!1,deleteOriginalAssets:r=!1}=e,i=[];return t.length>0&&i.push(l({algorithms:t,deleteOriginalAssets:r,skipIfLargerOrEqual:!1,exclude:[/\.(br)$/,/\.(gz)$/]})),n&&i.length>0&&i.push(u()),i}function C({prefixClass:e=`lenovo`,iconDir:t=`src/assets/icons`,componentName:n=`SvgIcon`,preserveColorDir:r}){let i={treeShaking:!1};return r&&(i.preserveColor=d.resolve(process.cwd(),r)),p({iconDir:[d.resolve(process.cwd(),t)],projectType:`vue`,vueVersion:3,dts:!1,componentName:n,prefix:void 0,symbolIdFormatter:(e,t)=>{let n=e.split(`/`);return t&&n.unshift(t),n.join(`-`).replace(/\.svg$/,``)},componentStyle:`width: 1em;height: 1em;fill: currentColor;vertical-align: -0.125em;`,svgSpriteDomId:`${e}-svg-dom`,domInsertionStrategy:`dynamic`,...i})}function w(e=``,t=8080){return m({reportTitle:`${e} Analyzer`,analyzerMode:`server`,analyzerPort:t+200,openAnalyzer:!0})}function T({base:e,primaryColor:t}){return h({checkInterval:1800*1e3,checkOnWindowFocus:!0,checkImmediately:!1,checkOnLoadFileError:!0,hiddenDefaultNotification:!1,logVersion:!1,notificationConfig:{primaryColor:t},injectFileBase:e??`/`})}function E(e,t){return Math.floor(Math.random()*(t-e+1))+e}function D(e){return import(e)}async function O(l){let u=[e({template:{compilerOptions:{isCustomElement:e=>e.startsWith(`micro-app`)}}}),t()];if(l.vueRouter)try{let{default:e}=await D(`vue-router/vite`);u.unshift(e(l.vueRouterOptions||{}))}catch(e){console.warn("[vite-config] `vueRouter` is enabled but `vue-router 5.x` is not installed, skip VueRouter plugin.",e)}if(l.unocss)try{let{default:e}=await D(`unocss/vite`);u.push(e({mode:`global`}))}catch(e){console.warn("[vite-config] `unocss` is enabled but `unocss` is not installed, skip UnoCSS plugin.",e)}if(l.iconify&&u.push(c({compiler:`vue3`,autoInstall:!0})),l.injectMetadata&&u.push(a({meta:{themeToken:l.themeToken,appInfo:l.appInfo},package:{dependencies:!0,devDependencies:!0}})),l.i18n&&u.push(r({fullInstall:!0,runtimeOnly:!0,...l.i18nOptions||{}})),l.isBuild?(l.legacy&&u.push(n({targets:[`> 0.2%`,`not dead`,`not op_mini all`]})),l.compress&&u.push(...S(l.compressOptions||{})),l.updateNotice&&u.push(T({base:l.base,primaryColor:l.themeToken?.colorPrimary}))):(l.turboConsole&&u.push(o({server:{port:(l.serverPort??8080)+E(100,1e3)},launchEditor:!0})),l.devtools&&u.push(s({launchEditor:`code`}))),l.svgIcon){let e=l.svgIconOptions??{};u.push(C({prefixClass:l.prefixClass,iconDir:e.iconDir,preserveColorDir:e.preserveColorDir}))}return l.html&&u.push(x(l.appTitle,l.appInfo)),l.mock&&u.push(i({})),l.analyzer&&u.push(w(l.appTitle,l.serverPort)),u}function k({pkg:e}={}){return`/**\n * version: v${e?.version}\n * author: ${typeof e?.author==`string`?e.author:e?.author&&e.author.name||``} \n * build time: ${new Date().toLocaleString()}\n */`}function A(e,t=!1){let n={};for(let r of e){let{prefix:e,target:i,rewrite:a}=r;a===void 0&&(a=!0),n[e]={target:i,changeOrigin:!0,ws:!0,rewrite:t=>a?t.replace(RegExp(`^${e}`),``):t,...b.httpsUrl.test(i)?{secure:!1}:{},...t?{configure:e=>{e.on(`proxyRes`,(e,t)=>{console.log(`proxy: `,y.red(t.originalUrl),` ===> `,y.green(e.client.servername+t.url))})}}:{}}}return n}function j(e){return f(process.cwd(),`.`,e)}function M(e){return g(async t=>{let{command:n}=t,r=await e?.(t),i={appInfo:{},devtools:!1,injectMetadata:!0,analyzer:!1,unocss:!0,iconify:!0,svgIcon:!0,html:!0,i18n:!0,license:!0,legacy:!0,updateNotice:!0,mock:!0,turboConsole:!0,...r?.application||{}},a=n===`build`;return _({base:i.base??`/`,logLevel:`info`,resolve:{alias:[{find:/@\//,replacement:`${j(`src`)}/`}]},server:{host:!0,port:i.serverPort??8080,open:i.openPage??!0,hmr:!0,proxy:A(i.proxyConfig||[],i.showProxyLog??!1),headers:{"Access-Control-Allow-Origin":`*`}},preview:{port:(i.serverPort??8080)+100,proxy:A(i.previewProxyConfig||[],i.showPreviewProxyLog??!1)},build:{outDir:`dist`,reportCompressedSize:!1,chunkSizeWarningLimit:5e3,assetsInlineLimit:1024,rolldownOptions:{output:{postBanner:i.license?k(i.appInfo):void 0}}},define:{__APP_INFO__:JSON.stringify(i.appInfo??{}),"import.meta.vitest":`undefined`},css:{preprocessorOptions:{less:{modifyVars:i.lessModifyVars||{},javascriptEnabled:!0}},postcss:{plugins:a?[v()]:[]}},plugins:await O({...i,isBuild:a})},r?.vite||{})})}function N(e){return M(e)}export{A as createProxy,O as createVitePlugins,N as defineConfig,k as generateProjectInfo};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gsc-basic/vite-config",
3
3
  "type": "module",
4
- "version": "1.1.3",
4
+ "version": "2.0.0",
5
5
  "description": "Vite Config for GSC Basic Service",
6
6
  "author": "Lenovo SSG BASD <-GSC_Scaffolding_Support@lenovo.com>",
7
7
  "license": "LicenseRef-Proprietary",
@@ -28,34 +28,32 @@
28
28
  "./dist"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@iconify/json": "^2.2.443",
32
- "unocss": "^66.6.2",
33
- "vite": "^7.3.1",
31
+ "@iconify/json": "^2.2.456",
32
+ "unocss": "^66.6.7",
33
+ "vite": "^8.0.3",
34
34
  "vue-router": "^5.0.3"
35
35
  },
36
36
  "dependencies": {
37
37
  "@intlify/unplugin-vue-i18n": "^11.0.7",
38
38
  "@plugin-web-update-notification/vite": "^2.0.2",
39
- "@vitejs/plugin-legacy": "^7.2.1",
39
+ "@vitejs/plugin-legacy": "^8.0.1",
40
40
  "@vitejs/plugin-vue": "^6.0.4",
41
41
  "@vitejs/plugin-vue-jsx": "^5.1.4",
42
42
  "ansis": "^4.2.0",
43
43
  "autoprefixer": "^10.4.27",
44
44
  "unplugin-icons": "^23.0.1",
45
- "unplugin-info": "^1.2.4",
45
+ "unplugin-info": "^1.3.1",
46
46
  "unplugin-svg-component": "^0.12.4",
47
47
  "unplugin-turbo-console": "^2.3.0",
48
- "unplugin-vue-components": "^31.0.0",
48
+ "unplugin-vue-components": "^32.0.0",
49
49
  "vite-bundle-analyzer": "^1.3.6",
50
- "vite-plugin-banner": "^0.8.1",
51
- "vite-plugin-compression2": "^2.4.0",
52
- "vite-plugin-mock-dev-server": "^2.0.7",
53
- "vite-plugin-qrcode": "^0.3.0",
54
- "vite-plugin-vue-devtools": "^8.0.6",
50
+ "vite-plugin-compression2": "^2.5.3",
51
+ "vite-plugin-mock-dev-server": "^2.1.1",
52
+ "vite-plugin-vue-devtools": "^8.1.1",
55
53
  "@gsc-basic/utils": "1.3.1"
56
54
  },
57
55
  "scripts": {
58
- "build": "tsup",
56
+ "build": "tsdown",
59
57
  "outdated": "pnpm outdated",
60
58
  "clean": "rimraf ./dist"
61
59
  }