构建工具

TS编译打包

项目中,关于打包时的ts编译,看到有些用ts,ts-loader,babel-loader,没懂几者什么区别,因此调研总结下。

4月 2, 2025

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.

4月 2, 2025

Webpack会有6吗

Webpack 5 已经发布很久了,好奇 Webpack 6还会有吗,还是说Webpack之后就退出历史舞台?最近翻了下Repo,得到了答案。

4月 2, 2025

WebPack插件实现变量名自动修改

以前做了个webpack插件domain-replace-loader,主要是实现将前端JS中域名进行替换,比如替换为新的域名或者全局window的JS属性,这样就避免了需要人工检索所有repo仓库。但有些需求并不是替换域名。最近就接到了 同事提过来的需求,即需要将代码里的变量名进行替换。比如原先叫T_PROJECT, 需要自动修改为P_PROJECT。为此我改造了下插件,使其支持了变量名自动修改。

2月 14, 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.

2月 14, 2025

redux-logger tree shaking不work

现象 使用redux-logger的项目中,在使用webpack生产模式打包后,还是有redux-logger的存在。

9月 14, 2024

前端模块导入方式对打包体积的影响

本文介绍关于前端模块导入方式对打包体积的影响,包括使用场景、实现细节等,以提高关于前端模块导入方式对打包体积的影响的效率。

8月 25, 2024

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.

8月 25, 2024

Webpack中自定义SourceMap生成

本文是作者对Webpack中自定义SourceMap生成的介绍,包括Webpack中自定义SourceMap生成的优势、实现细节、相关资料等,这些步骤可以帮助作者提高Webpack中自定义SourceMap生成的效率。

6月 30, 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.

6月 30, 2024