0.0.1-dev.5 • Published 2 years ago

@persagy2/build-config v0.0.1-dev.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

博锐尚格前端通用构建配置

About

  • 声明式配置 针对 vite 原有配置进行二次封装, 保留原 API 的基础上, 增加常用配置限定.
  • 统一管理 版本管理, 性能优化, 构建配置的统一处理
  • 版本锁定 锁定常用依赖项版本, 避免版本差异(参考: umijs)
  • 必要的检查 提供通用的 eslint 规范以及项目级别的必要性信息检查.

Usage

  • install
npm install @persagy2/build-config -D
# or
yarn add @persagy2/build-config --dev
  • 添加插件 (vite.config.ts)
import { defineConfig } from 'vite'
import { persagyApp } from '@persagy/build-config'

export default defineConfig({
    plugins: [persagyApp({})]
})
  • 配置 (persagy.config.json)

TIPS:

  • 建议通过 @persagy2/create-persagy-appcoding 上的模板项目来创建项目
  • persagy.config.json 预设了 Schema 协议, 遵循 ide 提示配置即可.
{
    "$schema": "https://unpkg.com/@persagy2/build-config/persagy-config.schema.json"
}

配置项说明 (已脱敏)

features (功能 & Todos 明细)

tagsfeaturetodo
lintpackage.json 应包含: packageManager, engines
lintpackage.json 依赖项应移除 ^, ~ 标识, 仅保留版本号 (支持 fix)