构建工具

Will There Be Webpack 6?

Webpack 5 has been out for a long time. Will there be a Webpack 6, or is Webpack exiting the stage? I checked the repo and found the answer.

Apr 2, 2025

Webpack Plugin to Auto-Rename Variables

I previously built a webpack loader called domain-replace-loader to replace domains in frontend JS, e.g., swapping to a new domain or a global window property, avoiding manual edits across repos. Sometimes the requirement isn’t about domains. A colleague recently asked to rename variables in code automatically. For example, rename T_PROJECT to P_PROJECT. I updated the plugin to support automatic variable renaming.

Feb 14, 2025

How Module Import Style Affects Bundle Size

Importing from lib vs. es vs. package root can change bundle size dramatically; why and how to choose.

Aug 25, 2024

Customizing Source Map Generation in Webpack

How to customize Source Map generation in Webpack, including when to enable it, how to exclude specific files, and important notes about content hashes.

Jun 30, 2024

Add Global Constants to a Frontend Project

Expose config from package.json into the built app via webpack DefinePlugin, with typing in TS and pitfalls to avoid.

Jan 25, 2022

Bulk-Replacing Domains in a Frontend Codebase

Replace hardcoded domains with dynamic variables across a codebase using a webpack plugin (AST + regex), with HMR caveats.

Dec 5, 2021

了解process.env.NODE_ENV

本文介绍了解process.env.NODE_ENV,包括使用场景、实现细节等,以提高了解process.env.NODE_ENV的效率。

Dec 5, 2021

Automating Blog Platform Deployment

CI/CD for a blog platform using Travis: build, rsync to VPS, restart services, plus tips for SSH keys, scripts, and pitfalls.

May 26, 2019

Fix "JavaScript heap out of memory" During Build

How to fix "JavaScript heap out of memory" during Angular/Webpack builds by increasing Node/V8 memory, with safer script options.

Oct 11, 2017

Webpack Build: File Hash Unchanged Despite Content Changes — Analysis and Fix

An analysis and fix for the issue where a Webpack build outputs files whose hash remains the same even though their content changes, including definitions, scenarios, and recommendations.

May 10, 2017