Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -32,14 +32,14 @@
|
||||
"eslint-plugin-import-x": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@eslint/js": "^9.9.0",
|
||||
"@types/eslint": "^9.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
||||
"@typescript-eslint/parser": "^8.0.1",
|
||||
"eslint": "^9.8.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
||||
"@typescript-eslint/parser": "^8.1.0",
|
||||
"eslint": "^9.9.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-jsdoc": "^50.0.0",
|
||||
"eslint-plugin-jsdoc": "^50.0.1",
|
||||
"eslint-plugin-jsonc": "^2.16.0",
|
||||
"eslint-plugin-n": "^17.10.2",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
@@ -47,7 +47,7 @@
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-regexp": "^2.6.0",
|
||||
"eslint-plugin-unicorn": "^55.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.1.2",
|
||||
"eslint-plugin-unused-imports": "^4.1.3",
|
||||
"eslint-plugin-vitest": "^0.5.4",
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
"globals": "^15.9.0",
|
||||
|
@@ -46,7 +46,7 @@
|
||||
"tailwindcss": "^3.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/json": "^2.2.235",
|
||||
"@iconify/json": "^2.2.236",
|
||||
"@iconify/tailwind": "^1.1.2",
|
||||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@tailwindcss/typography": "^0.5.14",
|
||||
|
@@ -36,7 +36,7 @@
|
||||
"resolve.exports": "^2.0.2",
|
||||
"vite-plugin-lib-inject-css": "^2.1.1",
|
||||
"vite-plugin-pwa": "^0.20.1",
|
||||
"vite-plugin-vue-devtools": "^7.3.7"
|
||||
"vite-plugin-vue-devtools": "^7.3.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/html-minifier-terser": "^7.0.2",
|
||||
|
@@ -25,6 +25,9 @@ const getDefaultPwaOptions = (name: string): Partial<PwaPluginOptions> => ({
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* importmap CDN 暂时不开启,因为有些包不支持,且网络不稳定
|
||||
*/
|
||||
const defaultImportmapOptions: ImportmapPluginOptions = {
|
||||
// 通过 Importmap CDN 方式引入,
|
||||
// 目前只有esm.sh源兼容性好一点,jspm.io对于 esm 入口要求高
|
||||
|
@@ -80,7 +80,7 @@ async function viteImportMapPlugin(
|
||||
const firstLayerKeys = Object.keys(scopes);
|
||||
const inputMapScopes: string[] = [];
|
||||
firstLayerKeys.forEach((key) => {
|
||||
inputMapScopes.push(...Object.keys(scopes[key]));
|
||||
inputMapScopes.push(...Object.keys(scopes[key] || {}));
|
||||
});
|
||||
const inputMapImports = Object.keys(imports);
|
||||
|
||||
@@ -160,7 +160,10 @@ async function viteImportMapPlugin(
|
||||
options.defaultProvider || DEFAULT_PROVIDER,
|
||||
);
|
||||
|
||||
const resultHtml = await injectShimsToHtml(html, esModuleShimsSrc);
|
||||
const resultHtml = await injectShimsToHtml(
|
||||
html,
|
||||
esModuleShimsSrc || '',
|
||||
);
|
||||
html = await minify(resultHtml || html, {
|
||||
collapseWhitespace: true,
|
||||
minifyCSS: true,
|
||||
|
@@ -16,8 +16,8 @@ function resolvePackageVersion(
|
||||
async function resolveMonorepoDependencies() {
|
||||
const { packages } = await getPackages();
|
||||
|
||||
const resultDevDependencies: Record<string, string> = {};
|
||||
const resultDependencies: Record<string, string> = {};
|
||||
const resultDevDependencies: Record<string, string | undefined> = {};
|
||||
const resultDependencies: Record<string, string | undefined> = {};
|
||||
const pkgsMeta: Record<string, string> = {};
|
||||
|
||||
for (const { packageJson } of packages) {
|
||||
|
@@ -6,6 +6,14 @@ import { fs } from '@vben/node-utils';
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
const getBoolean = (value: string | undefined) => value === 'true';
|
||||
|
||||
const getString = (value: string | undefined, fallback: string) =>
|
||||
value ?? fallback;
|
||||
|
||||
const getNumber = (value: string | undefined, fallback: number) =>
|
||||
Number(value) || fallback;
|
||||
|
||||
/**
|
||||
* 获取当前环境下生效的配置文件名
|
||||
*/
|
||||
@@ -63,6 +71,7 @@ async function loadAndConvertEnv(
|
||||
} & Partial<ApplicationPluginOptions>
|
||||
> {
|
||||
const envConfig = await loadEnv(match, confFiles);
|
||||
|
||||
const {
|
||||
VITE_APP_TITLE,
|
||||
VITE_BASE,
|
||||
@@ -74,22 +83,22 @@ async function loadAndConvertEnv(
|
||||
VITE_PWA,
|
||||
VITE_VISUALIZER,
|
||||
} = envConfig;
|
||||
const compress = VITE_COMPRESS || '';
|
||||
const compressTypes = compress
|
||||
|
||||
const compressTypes = (VITE_COMPRESS ?? '')
|
||||
.split(',')
|
||||
.filter((item) => item === 'brotli' || item === 'gzip');
|
||||
|
||||
return {
|
||||
appTitle: VITE_APP_TITLE ?? 'Vben Admin',
|
||||
base: VITE_BASE || '/',
|
||||
compress: !!compress,
|
||||
compressTypes: compressTypes as ('brotli' | 'gzip')[],
|
||||
devtools: VITE_DEVTOOLS === 'true',
|
||||
injectAppLoading: VITE_INJECT_APP_LOADING === 'true',
|
||||
nitroMock: VITE_NITRO_MOCK === 'true',
|
||||
port: Number(VITE_PORT) || 5173,
|
||||
pwa: VITE_PWA === 'true',
|
||||
visualizer: VITE_VISUALIZER === 'true',
|
||||
appTitle: getString(VITE_APP_TITLE, 'Vben Admin'),
|
||||
base: getString(VITE_BASE, '/'),
|
||||
compress: compressTypes.length > 0,
|
||||
compressTypes,
|
||||
devtools: getBoolean(VITE_DEVTOOLS),
|
||||
injectAppLoading: getBoolean(VITE_INJECT_APP_LOADING),
|
||||
nitroMock: getBoolean(VITE_NITRO_MOCK),
|
||||
port: getNumber(VITE_PORT, 5173),
|
||||
pwa: getBoolean(VITE_PWA),
|
||||
visualizer: getBoolean(VITE_VISUALIZER),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user