Atlas / Skills / tencentblueking / Bundle Optimization

Bundle OptimizationSAFE

skills/tencentblueking/bundle-optimization

蓝鲸智云容器管理平台(BlueKing Container Service)

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
—
Hosts
—
License
NOASSERTION
Stars
840
01

Overview

蓝鲸智云容器管理平台(BlueKing Container Service)

Read from source at commit 87a6fdb6f4b4OBSERVED · 2026-10-12
02

Install

Commands as the repository documents them. They are shown, not run.

npm install rollup-plugin-visualizer -D
npm install vite-plugin-compression -D
03

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
id: eng-bundle-opt
name: Vite 构建产物体积优化
category: engineering
description: 使用 Rollup Visualizer 分析产物,并通过拆包 (Code Splitting) 和 Tree Shaking 减少首屏体积。
tags: [vite, rollup, performance, optimization]
updated_at: 2026-01-09
---

# Vite 构建产物体积优化

当首屏加载慢 (FCP > 1.5s) 时,通常需要检查 JS Bundle 的体积。

## 1. 产物分析 (Visualizer)

首先"看见"哪些包最大。

```bash
npm install rollup-plugin-visualizer -D
```

## 2. 常用优化策略

### 路由懒加载 (Route Lazy Loading)
**这是收益最大的优化点**。

❌ `import UserList from './views/UserList.vue'`
✅ `component: () => import('./views/UserList.vue')`

### 依赖分包 (Manual Chunks)
将大型库(ECharts, bkui-vue)单独打包,避免 vendor hash 频繁变化。

### 按需引入 (Tree Shaking)
❌ `import _ from 'lodash'`
✅ `import debounce from 'lodash-es/debounce'`

### Gzip 压缩
```bash
npm install vite-plugin-compression -D
```

## 3. 完整配置模版

> 📦 获取完整 vite.config.ts 配置:`skill://bundle-optimization/assets/vite.config.optimization.ts`


---
## 📦 可用资源

- `skill://bundle-optimization/assets/vite.config.optimization.ts`

> 根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载
04

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryWARN
L1Static analysis of the codeNA
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (1)

MEDIUMInventory / provenance · inv.symlink · CWE-1104
.codebuddy
.codebuddy
Why it matters. link not followed

Gates applied: no_behavioural_pass.

Audited 2026-10-12 · audit v0.4.1 · source sha 87a6fdb6f4b4full audit observations/trust-audit/skill/tencentblueking__bundle-optimization.json · Report an issue / request a re-scan
05

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-1287a6fdb6f4b4SAFEB89first audit
06

Questions

What does the Bundle Optimization skill do?

蓝鲸智云容器管理平台(BlueKing Container Service)

Is Bundle Optimization safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Bundle Optimization access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

How current is this page?

The grade is for one exact copy of the source (87a6fdb6f4b4), read on 2026-10-12. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement