با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
کامپایلر بسته شدن چیست؟
Closure Compiler ابزاری برای دانلود و اجرای سریعتر جاوا اسکریپت است. به جای کامپایل کردن از زبان مبدأ به کد ماشین، از جاوا اسکریپت به جاوا اسکریپت بهتر کامپایل می شود. جاوا اسکریپت شما را تجزیه می کند، آن را تجزیه و تحلیل می کند، کدهای مرده را حذف می کند و باقیمانده را بازنویسی می کند و به حداقل می رساند. همچنین نحو، منابع متغیر و انواع را بررسی می کند و در مورد مشکلات رایج جاوا اسکریپت هشدار می دهد.
چگونه می توانم از کامپایلر بسته شدن استفاده کنم؟
شما می توانید از کامپایلر بسته به صورت زیر استفاده کنید:
یک برنامه جاوا منبع باز که می توانید از خط فرمان اجرا کنید. کتابخانه ای که می توانید از طریق Bazel به آن وابسته باشید. یک بسته NPM برای شروع کار با کامپایلر، «چگونه شروع کنم» را در زیر ببینید.
مزایای استفاده از Closure Compiler چیست؟
کارایی. Closure Compiler حجم فایل های جاوا اسکریپت شما را کاهش می دهد و آنها را کارآمدتر می کند و به بارگذاری سریعتر برنامه کمک می کند و نیاز به پهنای باند شما را کاهش می دهد.
بررسی کد. کامپایلر بسته شدن، هشدارهایی را برای جاوا اسکریپت غیرقانونی و هشدارهایی برای عملیات بالقوه خطرناک ارائه می دهد، و به شما کمک می کند جاوا اسکریپتی تولید کنید که دارای اشکال کمتر و نگهداری آسان تر است.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Closure Compiler is a tool that optimizes JavaScript for faster download and execution by analyzing, removing dead code, and minimizing the remaining code.\u003c/p\u003e\n"],["\u003cp\u003eIt offers benefits such as improved efficiency by reducing file size and enhanced code checking by providing warnings for potential issues.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the Closure Compiler through a command-line application, a simple web interface, or by integrating it into their development workflow via the provided resources and documentation.\u003c/p\u003e\n"]]],[],null,["What is the Closure Compiler?\n-----------------------------\n\n\nThe Closure Compiler is a tool for making JavaScript download and run\nfaster. Instead of compiling\nfrom a source language to machine code, it compiles from JavaScript to\nbetter JavaScript. It parses your JavaScript, analyzes it, removes\ndead code and rewrites and minimizes what's left. It also checks\nsyntax, variable references, and types, and warns about common\nJavaScript pitfalls.\n\nHow can I use the Closure Compiler?\n-----------------------------------\n\n\nYou can use the Closure Compiler as:\n- An open source Java application that you can run from the command line.\n- A library you can depend on via Bazel.\n- An NPM package\n- To get started with the compiler, see \"How do I start\" below.\n\nWhat are the benefits of using Closure Compiler?\n------------------------------------------------\n\n - **Efficiency.** The Closure Compiler reduces the size of\n your JavaScript files and makes them more efficient, helping your\n application to load faster and reducing your bandwidth needs.\n\n - **Code checking.** The Closure Compiler provides warnings\n for illegal JavaScript and warnings for potentially dangerous\n operations, helping you to produce JavaScript that is less buggy and\n easier to maintain.\n\n How do I start?\n ---------------\n\n\n - Download the most recently released JAR file from the [Maven repository](https://mvnrepository.com/artifact/com.google.javascript/closure-compiler).\n - Work through the [Application\n Hello World](/closure/compiler/docs/gettingstarted_app).\n - Read about [Advanced\n compilation](/closure/compiler/docs/api-tutorial3).\n - Explore [the project's source code](https://github.com/google/closure-compiler).\n\n \u003cbr /\u003e"]]