a11y.skipToMainContent
1

Java 脚本修改器

粘贴您的 JavaScript 代码, 以立即缩写它 。 删除注释, 折叠白空格, 剥离控制台.log 和调试器语句 .

Input: 0 charsOutput: 0 chars
More options
Was this tool helpful?
Send output to:
Advertisement

How to use JavaScript Minifier

  1. 粘贴您的 JavaScript 代码到输入字段 .
  2. 切换控制台.log和调试器删除的选项 .
  3. 点击“减少联合来文”.
  4. 复制已修改的代码并查看压缩数据.

{姓名}是什么来着?

此 JavaScript 修饰器通过去除单行和多行注释( 保留 URL) , 崩溃的白空, 以及可选地去除控制台. * 调用和调试器语句来减小代码大小 。

以百分比递减显示字符前/后计数 。 注:用于生产用可变操纵的微分,使用Terser或esbuilt等工具。

Advertisement

FAQ

这和Terser/UglifyJS一样好吗?
这个工具处理基本的微分(评论,白空,控制台去除). 为生产使用可变的布置和打花树,建议使用特尔泽等专用工具.
它是否在注释中保留了 URL ?
是的——包含"://"的单行评论被保留,因为它们可能是URL,而不是代码评论.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

← Back to Developer Tools · All tags

Last updated:

Advertisement