FAQ

已解决

background-attachment: fixed iOS 不支持

iOS has an issue preventing background-attachment: fixed from being used with background-size: cover. The Fixed Background Attachment Hack | CSS Tricks

改为使用 ::before 伪元素实现。

JavaScript heap out of memory

JavaScript heap out of memory

SSG 构建(valaxy build --ssg)时,vite-ssg 在同一进程中依次执行 client 构建、server 构建、页面渲染。构建阶段的 Vite resolved config 和插件系统会驻留内存,导致渲染阶段可用堆空间有限。

最低内存要求:--max-old-space-size=2304(约 2.3 GB)

bash
# 复现测试
pnpm test:space        # demo/yun
pnpm test:space:docs   # docs

Valaxy 会根据 V8 的 heap_size_limit 自动调整 SSG 行为:

堆限制beasties (Critical CSS)HTML minify并发数
≤ 2.5 GB禁用禁用1
≤ 3.1 GB启用启用2
≤ 4.2 GB启用启用4
> 4.2 GB启用启用8+

如果你在 CI 环境中遇到 OOM,可以通过设置 NODE_OPTIONS 增大堆限制:

bash
NODE_OPTIONS=--max-old-space-size=4096 pnpm build --ssg

During SSG build (valaxy build --ssg), vite-ssg runs client build, server build, and page rendering in the same process. The Vite resolved config and plugin system from the build phase remain in memory, leaving limited heap space for the rendering phase.

Minimum memory requirement: --max-old-space-size=2304 (~2.3 GB)

bash
# Reproduce tests
pnpm test:space        # demo/yun
pnpm test:space:docs   # docs

Valaxy automatically adjusts SSG behavior based on V8’s heap_size_limit:

Heap Limitbeasties (Critical CSS)HTML minifyConcurrency
≤ 2.5 GBDisabledDisabled1
≤ 3.1 GBEnabledEnabled2
≤ 4.2 GBEnabledEnabled4
> 4.2 GBEnabledEnabled8+

If you encounter OOM in CI environments, increase the heap limit via NODE_OPTIONS:

bash
NODE_OPTIONS=--max-old-space-size=4096 pnpm build --ssg

合并

使用 defu

但实测 defu faster than @fastify/deepmerge

合并单个配置:

bash
# benchmark
@fastify/deepmerge x 605,343 ops/sec ±0.87% (96 runs sampled)
deepmerge x 20,312 ops/sec ±1.06% (92 runs sampled)
merge-deep x 83,167 ops/sec ±1.30% (94 runs sampled)
ts-deepmerge x 175,977 ops/sec ±0.57% (96 runs sampled)
deepmerge-ts x 174,973 ops/sec ±0.44% (93 runs sampled)
lodash.merge x 89,213 ops/sec ±0.70% (98 runs sampled)

To Be Continued.

Contributors