360 Secure SkillHub
360 安全技能中心

workleap-web-configs

说明 Workleap 共享 TypeScript、Rsbuild、Rslib、Stylelint 与 Browserslist 配置的选型、安装、扩展、迁移及 Turborepo/GitHub Actions 集成,并给出配置排错要点。

分类:开发
workleap
热度 0.00
最近更新 2026-11-11 05:18:52

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add workleap/wl-web-configs/workleap-web-configs
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
workleap-web-configs
description
Workleap's shared web configuration packages (@workleap/typescript-configs, @workleap/rsbuild-configs, @workleap/rslib-configs, @workleap/stylelint-configs, @workleap/browserslist-config). Use when setting up, customizing, extending, or troubleshooting shared web tooling configs in a Workleap project — including TypeScript, Rsbuild, Rslib, Stylelint, Browserslist, and monorepo (Turborepo) strategies. Activate even if only one tool is mentioned, as the packages are designed to work together.
metadata
{"version":1.8}

wl-web-configs

Workleap's shared configuration library for web tooling. Provides pre-configured packages for TypeScript, Rsbuild, Rslib, Stylelint, and Browserslist.

Philosophy

  • No lock-in: Default configurations can always be extended or overridden
  • By project type: Configurations are composed internally and offered per project type for simplicity
  • ESM/ESNext by default: Targets modern JavaScript environments
  • Distributed via NPM: Easy to adopt new features by bumping package versions

Supported Tools (Active)

Tool Package Purpose
Browserslist @workleap/browserslist-config Browser targets for apps
Stylelint @workleap/stylelint-configs CSS linting
TypeScript @workleap/typescript-configs Type checking (linting only)
Rsbuild @workleap/rsbuild-configs Web application bundling
Rslib @workleap/rslib-configs Library bundling

In maintenance mode (do not recommend): PostCSS, SWC, webpack, tsup

Quick Reference

Which Configuration to Use?

Project Type TypeScript Bundler
Web app with React web-application.json @workleap/rsbuild-configs
React library library.json @workleap/rslib-configs
TypeScript library (no React) library.json @workleap/rslib-configs
Monorepo workspace root monorepo-workspace.json N/A

Browserslist (Apps Only)

pnpm add -D @workleap/browserslist-config browserslist
# .browserslistrc
extends @workleap/browserslist-config

Only for projects emitting application bundles. Libraries should not include Browserslist — the consuming application's Browserslist controls the final output targets.

To add custom browser targets while still using the shared config:

# .browserslistrc
extends @workleap/browserslist-config
IE 11
last 2 OperaMobile 12.1 versions

Reference Guide

For comprehensive setup guides, options, and examples, read the appropriate reference file:

  • TypeScript — references/typescript.md: Config files by project type, compiler option overrides, path mappings, CLI scripts, and migrating to TypeScript 7
  • Rsbuild — references/rsbuild.md: Dev/build/Storybook configs, predefined options, transformers, Turborepo setup, and migrating from webpack
  • Rslib — references/rslib.md: Library build/dev/Storybook configs, bundleless vs bundle, transformers, type declarations, and migrating from tsup
  • Stylelint — references/stylelint.md: Installation, .stylelintrc.json setup, Prettier integration, and VS Code settings
  • CI — references/ci.md: GitHub Actions workflows for polyrepo and Turborepo solutions, including Turborepo caching and PR filters

Critical Rules

  1. Stick to documented APIs — these packages are thin wrappers, and undocumented options won't be passed through to the underlying tool
  2. Avoid maintenance-mode packages — PostCSS, SWC, webpack, and tsup configs won't receive new features; recommend the active alternatives (Rsbuild, Rslib, Stylelint) instead
  3. ESM by default — all configs target ESM/ESNext because Workleap's toolchain assumes modern JavaScript environments
  4. Browserslist for apps only — libraries omit Browserslist because the consuming application's config controls the final output targets
  5. TypeScript for linting — the shared TypeScript configs focus on type-checking; bundlers handle transpilation, so don't mix concerns