Open post Performance

前端性能和加载体验优化实践 (附: PWA、离线包、内存优化、预渲染)

探讨了页面加载卡顿的原因并提出了多种优化方法。主要原因包括项目包或第三方脚本过大、JavaScript 执行阻塞页面加载、图片体积大且多等。优化策略包括构建缩包按需加载、减少图片体积等。文章还详细介绍了如何通过 Webpack 插件分析项目中用到的 npm 包及大小,以及如何通过调整图片尺寸、格式转换、压缩等方式减小图片体积。
Open post webpack

[EN] Using Multiple Configurations in webpack: Exporting an Array of Config Objects

webpack supports enabling multi-compiler mode by exporting an array of configuration objects, allowing multiple entries and bundles to be managed within a single process. This approach unifies build and watch workflows, reduces the complexity of multiple config files, and still supports targeted builds via name (config-name), balancing efficiency, maintainability, and flexibility.
Open post Docker

[EN] Troubleshooting `exec /PATH/entrypoint.sh` Docker Errors — Causes, Diagnostics, and Fixes

This guide analyzes common Docker startup failures like "no such file or directory" or "permission denied" involving "entrypoint.sh". Key causes include CRLF line endings, missing execution bits, incorrect shebangs, and architecture mismatches. It provides diagnostic steps (e.g., "sed -n l") and fixes such as using ".gitattributes" for LF normalization, applying "sed -i 's/\r$//'" in Dockerfiles to avoid extra packages, and handling archived Debian repositories (e.g., "node:10-buster") for legacy builds.