Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/en/guide/project/dir.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The repository uses Monorepo management, and the project structure is as follows
│ ├── node-utils # Node.js tools
│ ├── tsconfig # Common tsconfig settings
│ └── vite-config # Common Vite configuration
├── oxfmt.config.ts # Oxfmt config entry
├── oxlint.config.ts # Oxlint configuration file
├── oxfmt.config.mjs # Oxfmt config entry
├── oxlint.config.mjs # Oxlint configuration file
├── package.json # Project dependency configuration
├── packages # Project packages directory
│ ├── @core # Core package
Expand Down
4 changes: 2 additions & 2 deletions docs/src/en/guide/project/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pnpm oxfmt --check

### Configuration

The root Oxfmt entry file is `oxfmt.config.ts`, and its core configuration is located in `internal/lint-configs/oxfmt-config`.
The root Oxfmt entry file is `oxfmt.config.mjs`, and its core configuration is located in `internal/lint-configs/oxfmt-config`.

## Oxlint

Expand All @@ -64,7 +64,7 @@ pnpm oxlint --fix

### Configuration

The core Oxlint configuration is located in `internal/lint-configs/oxlint-config`, and the root entry file is `oxlint.config.ts`.
The core Oxlint configuration is located in `internal/lint-configs/oxlint-config`, and the root entry file is `oxlint.config.mjs`.

## ESLint

Expand Down
4 changes: 2 additions & 2 deletions docs/src/guide/project/dir.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
│ ├── node-utils # Node.js 工具
│ ├── tsconfig # 通用 tsconfig 配置
│ └── vite-config # 通用 Vite 配置
├── oxfmt.config.ts # Oxfmt 配置入口
├── oxlint.config.ts # Oxlint 配置文件
├── oxfmt.config.mjs # Oxfmt 配置入口
├── oxlint.config.mjs # Oxlint 配置文件
├── package.json # 项目依赖配置
├── packages # 项目包目录
│ ├── @core # 核心包
Expand Down
4 changes: 2 additions & 2 deletions docs/src/guide/project/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pnpm oxfmt --check

### 配置

Oxfmt 的根目录入口文件为 `oxfmt.config.ts`,其核心配置位于 `internal/lint-configs/oxfmt-config` 目录下,可以根据项目需求进行修改。
Oxfmt 的根目录入口文件为 `oxfmt.config.mjs`,其核心配置位于 `internal/lint-configs/oxfmt-config` 目录下,可以根据项目需求进行修改。

## Oxlint

Expand All @@ -64,7 +64,7 @@ pnpm oxlint --fix

### 配置

Oxlint 的核心配置位于 `internal/lint-configs/oxlint-config` 目录下,根目录入口文件为 `oxlint.config.ts`。
Oxlint 的核心配置位于 `internal/lint-configs/oxlint-config` 目录下,根目录入口文件为 `oxlint.config.mjs`。

## ESLint

Expand Down
45 changes: 21 additions & 24 deletions internal/vite-config/src/config/application.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import type { CSSOptions, UserConfig } from 'vite';
import type { CSSOptions, UserConfig } from "vite";

import type { DefineApplicationOptions } from '../typing';
import type { DefineApplicationOptions } from "../typing";

import path, { relative } from 'node:path';
import path, { relative } from "node:path";

import { findMonorepoRoot } from '@vben/node-utils';
import { findMonorepoRoot } from "@vben/node-utils";

import { NodePackageImporter } from 'sass-embedded';
import { defineConfig, loadEnv, mergeConfig } from 'vite';
import { NodePackageImporter } from "sass";
import { defineConfig, loadEnv, mergeConfig } from "vite";

import { defaultImportmapOptions, getDefaultPwaOptions } from '../options';
import { loadApplicationPlugins } from '../plugins';
import { loadAndConvertEnv } from '../utils/env';
import { getCommonConfig } from './common';
import { defaultImportmapOptions, getDefaultPwaOptions } from "../options";
import { loadApplicationPlugins } from "../plugins";
import { loadAndConvertEnv } from "../utils/env";
import { getCommonConfig } from "./common";

function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
return defineConfig(async (config) => {
Expand All @@ -21,14 +21,14 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
const { command, mode } = config;
const { application = {}, vite = {} } = options || {};
const root = process.cwd();
const isBuild = command === 'build';
const isBuild = command === "build";
const env = loadEnv(mode, root);

const plugins = await loadApplicationPlugins({
archiver: true,
archiverPluginOptions: {},
compress: false,
compressTypes: ['brotli', 'gzip'],
compressTypes: ["brotli", "gzip"],
devtools: true,
env,
extraAppConfig: true,
Expand All @@ -44,7 +44,7 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
nitroMockOptions: {},
print: !isBuild,
printInfoMap: {
'Vben Admin Docs': 'https://doc.vben.pro',
"Vben Admin Docs": "https://doc.vben.pro",
},
pwa: true,
pwaOptions: getDefaultPwaOptions(appTitle),
Expand All @@ -60,9 +60,9 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
build: {
rolldownOptions: {
output: {
assetFileNames: '[ext]/[name]-[hash].[ext]',
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'jse/index-[name]-[hash].js',
assetFileNames: "[ext]/[name]-[hash].[ext]",
chunkFileNames: "js/[name]-[hash].js",
entryFileNames: "jse/index-[name]-[hash].js",
minify: isBuild
? {
compress: {
Expand All @@ -72,7 +72,7 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
: false,
},
},
target: 'es2015',
target: "es2015",
},
css: createCssOptions(injectGlobalScss),
plugins,
Expand All @@ -82,18 +82,15 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
warmup: {
// 预热文件
clientFiles: [
'./index.html',
'./src/bootstrap.ts',
'./src/{views,layouts,router,store,api,adapter}/*',
"./index.html",
"./src/bootstrap.ts",
"./src/{views,layouts,router,store,api,adapter}/*",
],
},
},
};

const mergedCommonConfig = mergeConfig(
await getCommonConfig(),
applicationConfig,
);
const mergedCommonConfig = mergeConfig(await getCommonConfig(), applicationConfig);
return mergeConfig(mergedCommonConfig, vite);
});
}
Expand Down
File renamed without changes.
File renamed without changes.
92 changes: 46 additions & 46 deletions vben-admin.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,179 +2,179 @@
"folders": [
{
"name": "@vben/backend-mock",
"path": "apps/backend-mock"
"path": "apps/backend-mock",
},
{
"name": "@vben/web-antd",
"path": "apps/web-antd"
"path": "apps/web-antd",
},
{
"name": "@vben/web-antdv-next",
"path": "apps/web-antdv-next"
"path": "apps/web-antdv-next",
},
{
"name": "@vben/web-ele",
"path": "apps/web-ele"
"path": "apps/web-ele",
},
{
"name": "@vben/web-naive",
"path": "apps/web-naive"
"path": "apps/web-naive",
},
{
"name": "@vben/web-tdesign",
"path": "apps/web-tdesign"
"path": "apps/web-tdesign",
},
{
"name": "@vben/docs",
"path": "docs"
"path": "docs",
},
{
"name": "@vben/commitlint-config",
"path": "internal/lint-configs/commitlint-config"
"path": "internal/lint-configs/commitlint-config",
},
{
"name": "@vben/eslint-config",
"path": "internal/lint-configs/eslint-config"
"path": "internal/lint-configs/eslint-config",
},
{
"name": "@vben/oxfmt-config",
"path": "internal/lint-configs/oxfmt-config"
"path": "internal/lint-configs/oxfmt-config",
},
{
"name": "@vben/oxlint-config",
"path": "internal/lint-configs/oxlint-config"
"path": "internal/lint-configs/oxlint-config",
},
{
"name": "@vben/stylelint-config",
"path": "internal/lint-configs/stylelint-config"
"path": "internal/lint-configs/stylelint-config",
},
{
"name": "@vben/node-utils",
"path": "internal/node-utils"
"path": "internal/node-utils",
},
{
"name": "@vben/tsconfig",
"path": "internal/tsconfig"
"path": "internal/tsconfig",
},
{
"name": "@vben/vite-config",
"path": "internal/vite-config"
"path": "internal/vite-config",
},
{
"name": "@vben-core/design",
"path": "packages/@core/base/design"
"path": "packages/@core/base/design",
},
{
"name": "@vben-core/icons",
"path": "packages/@core/base/icons"
"path": "packages/@core/base/icons",
},
{
"name": "@vben-core/shared",
"path": "packages/@core/base/shared"
"path": "packages/@core/base/shared",
},
{
"name": "@vben-core/typings",
"path": "packages/@core/base/typings"
"path": "packages/@core/base/typings",
},
{
"name": "@vben-core/composables",
"path": "packages/@core/composables"
"path": "packages/@core/composables",
},
{
"name": "@vben-core/preferences",
"path": "packages/@core/preferences"
"path": "packages/@core/preferences",
},
{
"name": "@vben-core/form-ui",
"path": "packages/@core/ui-kit/form-ui"
"path": "packages/@core/ui-kit/form-ui",
},
{
"name": "@vben-core/layout-ui",
"path": "packages/@core/ui-kit/layout-ui"
"path": "packages/@core/ui-kit/layout-ui",
},
{
"name": "@vben-core/menu-ui",
"path": "packages/@core/ui-kit/menu-ui"
"path": "packages/@core/ui-kit/menu-ui",
},
{
"name": "@vben-core/popup-ui",
"path": "packages/@core/ui-kit/popup-ui"
"path": "packages/@core/ui-kit/popup-ui",
},
{
"name": "@vben-core/shadcn-ui",
"path": "packages/@core/ui-kit/shadcn-ui"
"path": "packages/@core/ui-kit/shadcn-ui",
},
{
"name": "@vben-core/tabs-ui",
"path": "packages/@core/ui-kit/tabs-ui"
"path": "packages/@core/ui-kit/tabs-ui",
},
{
"name": "@vben/constants",
"path": "packages/constants"
"path": "packages/constants",
},
{
"name": "@vben/access",
"path": "packages/effects/access"
"path": "packages/effects/access",
},
{
"name": "@vben/common-ui",
"path": "packages/effects/common-ui"
"path": "packages/effects/common-ui",
},
{
"name": "@vben/hooks",
"path": "packages/effects/hooks"
"path": "packages/effects/hooks",
},
{
"name": "@vben/layouts",
"path": "packages/effects/layouts"
"path": "packages/effects/layouts",
},
{
"name": "@vben/plugins",
"path": "packages/effects/plugins"
"path": "packages/effects/plugins",
},
{
"name": "@vben/request",
"path": "packages/effects/request"
"path": "packages/effects/request",
},
{
"name": "@vben/icons",
"path": "packages/icons"
"path": "packages/icons",
},
{
"name": "@vben/locales",
"path": "packages/locales"
"path": "packages/locales",
},
{
"name": "@vben/preferences",
"path": "packages/preferences"
"path": "packages/preferences",
},
{
"name": "@vben/stores",
"path": "packages/stores"
"path": "packages/stores",
},
{
"name": "@vben/styles",
"path": "packages/styles"
"path": "packages/styles",
},
{
"name": "@vben/types",
"path": "packages/types"
"path": "packages/types",
},
{
"name": "@vben/utils",
"path": "packages/utils"
"path": "packages/utils",
},
{
"name": "@vben/playground",
"path": "playground"
"path": "playground",
},
{
"name": "@vben/turbo-run",
"path": "scripts/turbo-run"
"path": "scripts/turbo-run",
},
{
"name": "@vben/vsh",
"path": "scripts/vsh"
}
]
"path": "scripts/vsh",
},
],
}
Loading