In 2001 [[Douglas Crockford]] introduced JSMin,<ref>{{Cite web |title=JSMin: The JavaScript Minifier |url=https://www.crockford.com/javascript/jsmin.html |website=Crockford.com |date=11 September 2001 |first=Douglas |last=Crockford |publisher=[[WP:SPS|Self-published]]|archive-url=https://web.archive.org/web/20020405140416/https://www.crockford.com/javascript/jsmin.html |archive-date=5 April 2002 }}</ref> which removed comments and whitespace from JavaScript code.<ref name=":1">{{Cite web |url = https://webplatform.github.io/docs/concepts/programming/javascript/minification/ |title = Code minification |website = webplatform.github.io |publisher=The WebPlatform Project |url-status = live |archive-url = https://web.archive.org/web/20160424125048/https://docs.webplatform.org/wiki/concepts/programming/javascript/minification |archive-date = 24 April 2016}}</ref> It was followed by YUI Compressor in 2007.<ref name=":1"/> In 2009, Google opened up its Closure toolkit, including Closure Compiler which contained a source mapping feature together with a Firefox extension called Closure Inspector.<ref>{{Cite web |url=https://arstechnica.com/information-technology/2009/11/google-opens-up-its-javascript-development-toolbox-to-all/ |title=Google opens up its JavaScript development toolbox to all |website=[[Ars Technica]] |first=Ryan |last=Paul |date=6 November 2009}}</ref> In 2010, Mihai Bazon introduced UglifyJS, which was superseded by UglifyJS2 in 2012; the rewrite was to allow for source map support.<ref>{{Cite web |url=http://lisperator.net/blog/should-you-switch-to-uglifyjs2/ |title=Should you switch to UglifyJS2? |last=Bazon |first=Mihai |website=lisperator.net |date=8 November 2012 |publisher=[[WP:SPS|Self-published]]}}</ref> From 2017, Alex Lam took over maintenance and development of UglifyJS2, replacing it with UglifyJS3 which unified the CLI with the API.<ref>{{Cite web |url=https://www.npmjs.com/package/uglify-js/v/3.0.0 |title=uglify-js NPM |website=npmjs.com }}</ref>
==Source mapping==
Line 35:
[[Visual Studio Code]] comes with minification support for several languages. It can readily browse the Visual Studio Marketplace to download and install additional minifiers.
JavaScript optimizers which can minify and generate source maps include UglifyJS and [[Google Closure Tools|Google Closure Compiler]]. In addition, certain online tools, such as Microsoft Ajax Minifier,<ref>[https://github.com/Microsoft/ajaxmin Microsoft Ajax Minifier]. Ajaxmin.codeplex.com (13 September 2012).</ref> the [[YUI Library|Yahoo! YUI]] Compressor or [[Pretty Diff]],<ref>[http://prettydiff.com/?m=minify Pretty Diff]. Pretty Diff.</ref> can compress [[Cascading Style Sheets|CSS]] files.{{citation needed|date=Novemberdatee 2011}}multiple Forscript minificationfiles ofinto HTMLa codesingle therefile arefor theclient followingdownload. tools:JavaScript HtmlCompressor,<ref>[https://code.google.com/archive/p/htmlcompressor/source HtmlCompressor].maps can make code.google.com/archive/p/htmlcompressor(11readable Februaryand 2017).</ref>debuggable HTMLMinifier<ref>[https://github.com/kangax/html-minifier/even HTMLMinifier].after github.com/kangax/html-minifierit (11has Februarybeen 2017).</ref>combined and WebMarkupMinminified.<ref>[https{{Cite web|url=http://githubwww.html5rocks.com/Taritsynen/WebMarkupMintutorials/ WebMarkupMin]. github.comdevelopertools/Taritsynsourcemaps/WebMarkupMin|title (11= FebruaryIntroduction 2017).</ref>to ThereJavaScript isSource aMaps Power-ShellscriptHTML5 named "minifyPS"<ref>[http://minifyps.codeplex.com minifyPS]. Minifyps.codeplex.com (22 February 2012).Rocks}}</ref> that is able to shrink PowerShell script code as well as JavaScript code.
===Web development===
Components and libraries for [[Web application]]s and websites have been developed to optimize file requests and reduce page load times by shrinking the size of various files.
JavaScript and [[Cascading Style Sheet]] (CSS) resources may be minified, preserving their behavior while considerably reducing their file size. Libraries available online are capable of minification and optimization to varying degrees. Some libraries also merge multiple script files into a single file for client download. JavaScript source maps can make code readable and debuggable even after it has been combined and minified.<ref>{{Cite web|url=http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/|title = Introduction to JavaScript Source Maps - HTML5 Rocks}}</ref>