From: Samuel Reed Date: Tue, 19 Jan 2016 19:24:36 +0000 (-0600) Subject: Update README for /** @const */ X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=918c17bd88647899be7fa1d9adabfe635cd6102d;p=UglifyJS.git Update README for /** @const */ --- diff --git a/README.md b/README.md index 67324dbd..6dea439a 100644 --- a/README.md +++ b/README.md @@ -395,6 +395,8 @@ separate file and include it into the build. For example you can have a ```javascript const DEBUG = false; const PRODUCTION = true; +// Alternative for environments that don't support `const` +/** @const */ var STAGING = false; // etc. ``` @@ -404,8 +406,8 @@ and build your code like this: UglifyJS will notice the constants and, since they cannot be altered, it will evaluate references to them to the value itself and drop unreachable -code as usual. The possible downside of this approach is that the build -will contain the `const` declarations. +code as usual. The build will contain the `const` declarations if you use +them. If you are targeting < ES6 environments, use `/** @const */ var`. ## Beautifier options