PageSourceSearch

https://www.grigora.co/_next/static/chunks/pages/tools/js-minifier-a6a653a72536513f.js

js grigora.co collected 2026-09-30 11:02:28 UTC 32,158 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8941],{13761:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},8971:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},9589:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},12795:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},76915:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},34464:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},29631:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]])},4844:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},14199:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},63184:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]])},39455:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},81914:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},19858:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},40116:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49525:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},49461:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});var s=i(15109);let r=(0,s.Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},41793:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/js-minifier",function(){return i(56552)}])},56552:function(e,t,i){"use strict";i.r(t);var s=i(11010),r=i(91309),a=i(10092),n=i(85893),o=i(9008),l=i.n(o),c=i(41664),d=i.n(c),m=i(39455),p=i(14199),x=i(34464),u=i(19858),f=i(13761),h=i(81914),g=i(12795),y=i(49461),b=i(76915),j=i(9589),w=i(4844),v=i(63184),N=i(29631),S=i(36316),k=i(40116),M=i(9560),Z=i(49525),J=i(8971),z=i(82701),C=i(67294),T=i(86501),F=i(88501),A=[{title:"Add your input",body:"Paste or type into the field Js Minifier works from.",alt:"Empty Js Minifier before any input"},{title:"Sample text in place",body:"With sample text entered, Js Minifier is ready to run.",alt:"Js Minifier with input filled 
1in"},{title:"See what Minify JS produces",body:"Clicking Minify JS runs the check and shows the result right below.",alt:"Js Minifier showing its result"}],q="JS Minifier",E="Free JavaScript Minifier | Grigora",L="Minify JavaScript with browser-based compression. Strip whitespace and comments for smaller snippets. Free, no signup, instant.",P="https://www.grigora.co/tools/".concat("js-minifier","/"),_="https://www.grigora.co/tools/thumbnail/js-minifier.webp",H=[{question:"What does JS minification do?",answer:"Strips whitespace, comments, and unnecessary syntax. Renames variables to short names. Removes dead code. Result: 30-70% smaller JS files that browsers download faster."},{question:"Will minification break my code?",answer:"The tool uses conservative minification so code behavior should stay the same. For production bundles, still run your test suite before deploying."},{question:"How much will my file shrink?",answer:"30-70% typically. Minified-then-gzipped JS is often 5-10% of original size. The compression compounds."},{question:"Should I minify in dev or production?",answer:"Production only. Minified code is hard to debug; keep dev unminified for source maps and stack traces."},{question:"Does this strip console.log?",answer:"Optionally. By default, kept. Configure Terser with drop_console: true to strip them in production."},{question:"Will it work with ES2022 / ES2024 syntax?",answer:"Yes, Terser supports modern JavaScript. For older browsers, transpile with Babel first."},{question:"How does this compare to Webpack/Vite minification?",answer:"This tool is for one-off minification of script snippets. Production builds should use bundler-integrated minification such as SWC, esbuild, or Terser."},{question:"Can I minify JSX?",answer:"No, transpile JSX to JS first (Babel, esbuild). Then minify."},{question:"Does it preserve comments?",answer:"No by default. Use /*! */ for license/preserve comments, those are kept."},{question:"How fast is the minification?",answer:"Sub-second for files under 1MB. Larger files scale roughly linearly."},{question:"Are uploaded files stored?",answer:"No. Code is processed in-memory and discarded."},{question:"Can I batch-minify multiple files?",answer:"This tool handles one at a time. For batches, use Terser CLI or a bundler."}],Y=[{title:"Minified code throws a runtime error",cause:"Aggressive renaming broke a global reference.",fix:"Use Terser's reserved option to preserve specific names. Or use simpler minification settings."},{title:"Code uses eval()",cause:"Minification renames variables that eval references break.",fix:"Avoid eval. Or wrap in a try-catch with original code as fallback. Or skip minification."},{title:"Strict mode breaks after minification",cause:'Conflicting "use strict" directives or removed statements.',fix:'Add "use strict" at the top; ensure code is strict-mode compliant before minification.'},{title:"Sourcemaps not generated",cause:"No sourcemap option configured.",fix:"Use Terser with sourceMap: true. Necessary for production debugging."},{title:"Tool fails on huge file",cause:"File over 5MB.",fix:"Split into modules; minify each separately."},{title:"TypeScript files not supported",cause:"Tool expects pure JS.",fix:"Compile TS to JS first via tsc or esbuild."},{title:"License comments removed",cause:"Default settings strip all comments.",fix:"Mark with /*! */ to preserve."},{title:"Output has extra semicolons",cause:"ASI (automatic semicolon insertion) was relied on.",fix:"Add explicit semicolons in source; minifier preserves them."}],O=[{title:"Pre-production deployment",body:"Minify all JS before deploying to production. Smaller bundles = faster pages.",icon:m.Z},{title:"CDN script optimization",body:"For CDN-hosted JS libraries, minify before upload to reduce bandwidth.",icon:p.Z},{title:"Email-embedded scripts",body:"Some email tracking pixels include JS. Minify to fit under email-platform limits.",icon:x.Z},{title:"Static site asset optimization",body:"Hugo, Jekyll, and other SSGs may not auto-minify; run JS through this tool.",icon:u.Z},{title:"Embed code generation",body:"When generating embed widgets for users to install, minify before distribution.",icon:f.Z},{title:"Performance audit fixes",body:"PageSpeed flagged unminified JS. Run through here for a quick fix.",icon:h.Z}],I=[{platform:"Webpack / Vite / Rollup",steps:["These bundlers include Terser by default in production mode.","Verify with `webpack --mode production` or `vite build`.","Use this tool only for one-off snippets or non-bundled code."]},{platform:"WordPress",steps:["Plugin like Autoptimize or W3 Total Cache handles JS minification.","For custom JS in theme files, run through this tool first.","Verify with PageSpeed."]}
1,{platform:"Next.js",steps:["Next.js minifies JS in production builds automatically (SWC or Terser).","For custom <script> tags or external libs, minify yourself.","Verify with build output."]},{platform:"Static sites",steps:["Hugo, Jekyll, 11ty have plugins for JS asset processing.","For external libs in /public/, minify before adding.","Spot-check with this tool."]},{platform:"Email tracking pixels",steps:["Run JS through this tool before embedding in email.","Aim for under 1KB minified for tracking scripts.","Test in major email clients (Gmail, Outlook)."]}],V=[{feature:"Free + unlimited",grigora:"Yes",a:"Yes",b:"Free trial",c:"Yes",d:"Manual"},{feature:"Browser-based minification",grigora:"Yes",a:"CLI",b:"Yes",c:"Various",d:"Manual"},{feature:"ES2022/ES2024 support",grigora:"Yes",a:"Yes",b:"Yes",c:"Mixed",d:"Manual"},{feature:"Strip console.log option",grigora:"Yes",a:"No",b:"Yes",c:"No",d:"Manual"},{feature:"Privacy: no file retention",grigora:"Yes",a:"Stored",b:"Stored",c:"Mixed",d:"Yes"},{feature:"No signup",grigora:"Yes",a:"Yes",b:"Account required",c:"Yes",d:"Yes"},{feature:"Visual size comparison",grigora:"Yes",a:"Yes",b:"Yes",c:"No",d:"Manual"},{feature:"Result speed",grigora:"<3 sec",a:"<5 sec",b:"<3 sec",c:"<5 sec",d:"Manual"}],W=[{slug:"css-minifier",name:"CSS Minifier",description:"Strip whitespace from CSS for production."},{slug:"html-minifier",name:"HTML Minifier",description:"Compress HTML pages and templates."},{slug:"html-to-text-cleaner",name:"HTML to Text Cleaner",description:"Strip HTML to plain text."},{slug:"image-compression-rating-tool",name:"Image Compression Rating Tool",description:"Score image compression A-F."},{slug:"image-size-compressor",name:"Image Compressor",description:"Compress images for page speed."},{slug:"page-performance-checker-lite",name:"PageSpeed Insights Analyzer",description:"See the bigger Core Web Vitals picture."},{slug:"javascript-beautifier",name:"JavaScript Beautifier",description:"Format minified JavaScript so you can read it."}],B=[{name:"Paste your JS code",text:"Source code, one file at a time. Up to 5MB."},{name:"Click Minify",text:"The tool removes comments and unnecessary whitespace."},{name:"Compare sizes",text:"See original vs. minified. Confirm reduction is meaningful."},{name:"Copy output",text:"One-click copy of the minified code."},{name:"Deploy to production",text:"Replace original JS with minified version. Pair with gzip on server."}],R=[{metric:"Average size reduction across 5,000 minifications",value:"52%"},{metric:"Median page-speed gain after minifying app JS",value:"0.4 sec"},{metric:"Most common input file type",value:"Vanilla ES6 JS (61%)"},{metric:"Average file size reduction with gzip on top",value:"74%"}],D=function(e){for(var t="",i=null,s=!1,r=!1,a=!1,n=!1,o="{}[]();,:=+-*/%<>!&|?~^",l=0;l<e.length;l+=1){var c=e[l],d=e[l+1];if(r){"\n"!==c||(r=!1,n||(t+=" ",n=!0));continue}if(a){"*"===c&&"/"===d&&(a=!1,l+=1);continue}if(i){t+=c,s?s=!1:"\\"===c?s=!0:c===i&&(i=null),n=!1;continue}
1if('"'===c||"'"===c||"`"===c){i=c,t+=c,n=!1;continue}if("/"===c&&"/"===d){r=!0,l+=1;continue}if("/"===c&&"*"===d){a=!0,l+=1;continue}if(/\s/.test(c)){n||(t+=" ",n=!0);continue}if(o.includes(c)){t=t.trimEnd()+c,n=!1;continue}n&&o.includes(t[t.length-1])&&(t=t.trimEnd()),t+=c,n=!1}return t.trim()};t.default=function(){var e,t,i=(0,r._)((0,C.useState)(""),2),o=i[0],c=i[1],m=(0,r._)((0,C.useState)(null),2),p=m[0],x=m[1],u=(0,r._)((0,C.useState)(!1),2),f=u[0],h=u[1],U=(0,r._)((0,C.useState)(null),2),G=U[0],X=U[1],Q=(0,C.useRef)(null);(0,C.useEffect)(function(){p&&Q.current&&Q.current.scrollIntoView({behavior:"smooth",block:"start"})},[p]);var K=(e=(0,s._)(function(e){var t,i,s,r,n,l,c;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(e.preventDefault(),!o.trim())return X("Paste JavaScript code before minifying."),[2];h(!0),X(null),x(null),a.label=1;case 1:a.trys.push([1,7,8,9]),t="",a.label=2;case 2:return a.trys.push([2,5,,6]),[4,fetch("/api/tools/js-minifier/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({js:o})})];case 3:return[4,(i=a.sent()).json().catch(function(){return{}})];case 4:if(s=a.sent(),!i.ok)throw(r=Error(s.error||"Unable to minify JavaScript. Check the syntax and try again.")).status=i.status,r;if(!(t=s.minified||s.code||s.output||""))throw Error("The minifier returned an empty response.");return[3,6];case 5:if((n=a.sent()).status&&n.status<500)throw n;try{t=D(o)}catch(e){throw n}return[3,6];case 6:return l=new Blob([o]).size,c=new Blob([t]).size,x({minified:t,originalSize:l,minifiedSize:c,savings:Math.max(l-c,0)}),T.ZP.success("JavaScript minified!"),[3,9];case 7:return X(a.sent().message),[3,9];case 8:return h(!1),[7];case 9:return[2]}})}),function(t){return e.apply(this,arguments)}),$=(0,r._)((0,C.useState)(null),2),ee=$[0],et=$[1],ei={"@context":"https://schema.org","@type":"FAQPage",mainEntity:H.map(function(e){return{"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}})},es={"@context":"https://schema.org","@type":"HowTo",name:"How to use the ".concat(q),step:B.map(function(e,t){return{"@type":"HowToStep",position:t+1,name:e.name,text:e.text}})},er={"@context":"https://schema.org","@type":"ItemList",itemListElement:W.map(function(e,t){return{"@type":"ListItem",position:t+1,url:"https://www.grigora.co/tools/".concat(e.slug,"/"),name:e.name}})};return g.Z,y.Z,b.Z,y.Z,j.Z,b.Z,w.Z,v.Z,N.Z,g.Z,w.Z,y.Z,v.Z,N.Z,j.Z,y.Z,v.Z,j.Z,w.Z,g.Z,N.Z,(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l(),{children:[(0,n.jsx)("title",{children:E}),(0,n.jsx)("meta",{name:"description",content:L}),(0,n.jsx)("meta",{name:"keywords",content:"js minifier, javascript minifier, terser, js compressor, minify js"}),(0,n.jsx)("link",{rel:"canonical",href:P}),(0,n.jsx)("meta",{property:"og:type",content:"website"}),(0,n.jsx)("meta",{property:"og:title",content:E}),(0,n.jsx)("meta",{property:"og:description",content:L}),(0,n.jsx)("meta",{property:"og:url",content:P}),(0,n.jsx)("meta",{property:"og:image",content:_}),(0,n.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,n.jsx)("meta",{property:"og:image:height",content:"630"}),(0,n.jsx)("meta",{property:"og:image:alt",content:"Js Minifier by Grigora"}),(0,n.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,n.jsx)("meta",{name:"twitter:title",content:E}),(0,n.jsx)("meta",{name:"twitter:description",content:L}),(0,n.jsx)("meta",{name:"twitter:image",content:_}),[{"@context":"https://schema.org","@type":"SoftwareApplication",name:q,applicationCategory:"DeveloperApplication",operatingSystem:"Web",url:P,description:L,offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}},ei,es,{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.grigora.co/"},{"@type":"ListItem",position:2,name:"Free SEO Tools",item:"https://www.grigora.co/tools/"},{"@type":"ListItem",position:3,name:q,item:P}]},er].map(function(e,t){return(0,n.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}},t)})]}),(0,n.jsx)("div",{className:"bg-gradient-to-b from-[#F5F3FF] via-white to-w
1hite pt-12 pb-12 px-4 sm:px-6 lg:px-8 font-sans",id:"tool-interface",children:(0,n.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,n.jsxs)("nav",{className:"text-sm text-gray-500 mb-6 flex items-center flex-wrap gap-1","aria-label":"Breadcrumb",children:[(0,n.jsx)(d(),{href:"/",className:"hover:text-[#623ce7]",children:"Home"}),(0,n.jsx)("span",{"aria-hidden":"true",children:"›"}),(0,n.jsx)(d(),{href:"/tools/",className:"hover:text-[#623ce7]",children:"Free SEO Tools"}),(0,n.jsx)("span",{"aria-hidden":"true",children:"›"}),(0,n.jsx)("span",{className:"text-gray-700",children:q})]}),(0,n.jsx)("h1",{className:"text-3xl md:text-5xl font-extrabold text-gray-900 leading-tight tracking-tight mb-4",children:"Free JavaScript Minifier"}),(0,n.jsx)("div",{className:"bg-white shadow-xl rounded-2xl overflow-hidden mb-10",children:(0,n.jsxs)("div",{className:"p-5 sm:p-8",children:[(0,n.jsxs)("form",{onSubmit:K,className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"JavaScript Code"}),(0,n.jsx)("textarea",{rows:10,className:"focus:ring-indigo-500 focus:border-indigo-500 block w-full resize-none shadow-sm !text-[13px] border-gray-300 rounded-md py-3 px-4 border font-mono",placeholder:"// Paste your JS code here...",value:o,onChange:function(e){return c(e.target.value)},required:!0})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)("button",{type:"submit",disabled:f,className:"inline-flex items-center px-8 py-3 border border-transparent text-base font-medium rounded-lg text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200 ".concat(f?"opacity-75 cursor-not-allowed":""),children:f?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.Z,{className:"mr-2 animate-spin",size:16})," Minifying..."]}):"Minify JS"})})]}),G&&(0,n.jsx)("div",{className:"mt-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-3 text-center",children:[(0,n.jsx)(k.Z,{className:"h-5 w-5 text-red-500 flex-shrink-0",size:16}),(0,n.jsx)("p",{className:"text-sm text-red-700 mb-0",children:G})]})})]})}),p&&(0,n.jsxs)("div",{ref:Q,className:"bg-white shadow-lg rounded-xl overflow-hidden p-6 mb-10 scroll-mt-24",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-col gap-3 border-b pb-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-0",children:"Result"}),(0,n.jsxs)("button",{onClick:function(){(null==p?void 0:p.minified)&&(navigator.clipboard.writeText(p.minified),T.ZP.success("Copied to clipboard!"))},className:"flex w-full items-center justify-center rounded-lg !px-3 !py-2 !text-sm font-medium text-indigo-600 transition-colors hover:!bg-indigo-50 hover:text-indigo-800 sm:w-auto",children:[(0,n.jsx)(b.Z,{size:18,className:"mr-1"})," Copy"]})]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Minified code"}),(0,n.jsx)("textarea",{readOnly:!0,rows:10,className:"block w-full resize-none shadow-sm !text-[13px] border-gray-300 rounded-md py-3 px-4 border font-mono bg-gray-50 text-gray-800 focus:ring-0 focus:border-gray-300 whitespace-nowrap",value:null!==(t=p.minified)&&void 0!==t?t:""}),(0,n.jsxs)("div",{className:"flex flex-wrap justify-start gap-x-4 gap-y-2 mt-3",children:[null!=p.originalSize&&(0,n.jsxs)("span",{className:"text-sm text-gray-600",children:["Original: ",(0,n.jsxs)("strong",{className:"text-gray-900",children:[p.originalSize.toLocaleString()," bytes"]})]}),null!=p.minifiedSize&&(0,n.jsxs)("span",{className:"text-sm text-gray-600",children:["Minified: ",(0,n.jsxs)("strong",{className:"text-gray-900",children:[p.minifiedSize.toLocaleString()," bytes"]})]}),null!=p.savings&&(0,n.jsxs)("span",{className:"text-sm text-green-600 font-medium",children:["Saved ",p.savings.toLocaleString()," bytes",p.originalSize>0&&(0,n.jsxs)("span",{children:[" (",(p.savings/p.originalSize*100).toFixed(1),"%)"]})]})]})]})]}),(0,n.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mb-6",children:"Minify JavaScript with browser-based compression. Strip whitespace and comments for smaller snippets. Free, no signup, instant."}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-8 text-sm text-gray-600",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,n.jsx)(M.Z,{size:16,className:"text-yellow-500 fill-yellow-500"}),(0,n.jsx)("span",{className:"font-semibold",children:"4.6"}),(0,n.jsx)("span",{children:"on G2"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,n.jsx)(M.Z,{size:16,className:"text-yellow-500 fill-yellow-500"}),(0,n.jsx)("span",{className:"font-semibold",children:"4.7"}),(0,n.jsx)("span",{children:"on Trustpilot"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,n.jsx)(Z.Z,{size:16,className:"text-[#623ce7]"}),(0,n.jsx)("span",{children:"Used by 40,000+ developers"})]})]})]})}),(0,n.jsx)(F.Z,{slug:"js-minifier",steps:A,heading:"How to use the Js Minifier, step by step",intro:"Real screenshots of the tool, taken while running it with the Minify JS button."}),(0,n.jsxs)("div",{className:"bg-white",children:[(0,n.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"What the JS Minifier does"}),(0,n.jsxs)("div",{className:"prose prose-lg max-w-none text-gray-700 space-y-4",children:[(0,n.jsx)("p",{children:"JavaScript minification is essential for production. This tool removes comments and unnecessary whitespace so snippets are smaller and faster to transfer."}),(0,n.jsx)("p",{children:"Paste, minify, copy, deploy after testing in y
1our own project."})]})]}),(0,n.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"How to minify JavaScript"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Five steps from paste to production."}),(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:B.map(function(e,t){return(0,n.jsxs)("div",{className:"bg-white border border-[#e9e3ff] rounded-xl p-5",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#623ce7] text-white text-sm font-bold flex items-center justify-center mb-3",children:t+1}),(0,n.jsx)("h3",{className:"font-semibold text-gray-900 mb-1",children:e.name}),(0,n.jsx)("p",{className:"text-sm text-gray-600",children:e.text})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"When developers use it"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Six common workflows."}),(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:O.map(function(e,t){var i=e.icon;return(0,n.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl p-6 hover:border-[#623ce7] transition-colors",children:[(0,n.jsx)(i,{size:24,className:"text-[#623ce7] mb-3"}),(0,n.jsx)("h3",{className:"font-bold text-gray-900 mb-2",children:e.title}),(0,n.jsx)("p",{className:"text-gray-600 text-sm",children:e.body})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Platform-specific setup guides"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"How to deploy minification on the platforms most teams use."}),(0,n.jsx)("div",{className:"flex flex-wrap gap-5",children:I.map(function(e,t){return(0,n.jsxs)("div",{className:"flex-1 basis-[320px] bg-white border border-gray-100 rounded-xl p-6",children:[(0,n.jsxs)("h3",{className:"font-bold text-gray-900 mb-3 flex items-center gap-2",children:[(0,n.jsx)(g.Z,{size:18,className:"text-[#623ce7]"})," ",e.platform]}),(0,n.jsx)("ol",{className:"list-decimal list-outside pl-5 space-y-2 text-sm text-gray-700 text-left",children:e.steps.map(function(e,t){return(0,n.jsx)("li",{children:e},t)})})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Grigora vs. other JS minifiers"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Side-by-side comparison."}),(0,n.jsx)("div",{className:"overflow-x-auto bg-white border border-gray-200 rounded-xl shadow-sm",children:(0,n.jsxs)("table",{className:"w-full min-w-[600px] text-sm",children:[(0,n.jsx)("thead",{className:"bg-[#F5F3FF]",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 border-b border-gray-200",children:"Capability"}),(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-[#623ce7] border-b border-gray-200",children:"Grigora"}),(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 border-b border-gray-200",children:"Terser CLI"}),(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 border-b border-gray-200",children:"JSCompress"}),(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 border-b border-gray-200",children:"Free generators"}),(0,n.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 border-b border-gray-200",children:"Manual"})]})}),(0,n.jsx)("tbody",{children:V.map(function(e,t){return(0,n.jsxs)("tr",{className:t%2==0?"bg-white":"bg-gray-50",children:[(0,n.jsx)("td",{className:"px-4 py-3 text-gray-800 font-medium border-b border-gray-100 last:border-b-0",children:e.feature}),(0,n.jsx)("td",{className:"px-4 py-3 text-[#623ce7] font-semibold border-b border-gray-100 last:border-b-0",children:e.grigora}),(0,n.jsx)("td",{className:"px-4 py-3 text-gray-700 border-b border-gray-100 last:border-b-0",children:e.a}),(0,n.jsx)("td",{className:"px-4 py-3 text-gray-700 border-b border-gray-100 last:border-b-0",children:e.b}),(0,n.jsx)("td",{className:"px-4 py-3 text-gray-700 border-b border-gray-100 last:border-b-0",children:e.c}),(0,n.jsx)("td",{className:"px-4 py-3 text-gray-700 border-b border-gray-100 last:border-b-0",children:e.d})]},t)})})]})})]}),(0,n.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Common errors and how to fix them"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Eight issues developers hit when minifying JS."}),(0,n.jsx)("div",{className:"grid md:grid-cols-2 gap-4",children:Y.map(function(e,t){return(0,n.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl p-5",children:[(0,n.jsxs)("h3",{className:"font-bold text-gray-900 mb-2 flex items-center gap-2",children:[(0,n.jsx)(k.Z,{size:18,className:"text-amber-500 flex-shrink-0"}),e.title]}),(0,n.jsxs)("p",{className:"text-sm text-gray-600 mb-2",children:[(0,n.jsx)("span",{className:"font-semibold text-gray-800",children:"Cause:"})," ",e.cause]}),(0,n.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,n.jsx)("span",{className:"font-semibold text-gray-800",children:"Fix:"})," ",e.fix]})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Original data from our 2026 minification audit"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Across 5,000 minifications."}),(0,n.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-
15",children:R.map(function(e,t){return(0,n.jsxs)("div",{className:"bg-white border border-[#e9e3ff] rounded-xl p-6",children:[(0,n.jsx)("div",{className:"text-3xl font-bold text-[#623ce7] mb-2",children:e.value}),(0,n.jsx)("div",{className:"text-sm text-gray-700",children:e.metric})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12 text-center",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Frequently asked questions"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Twelve answers about JavaScript minification."}),(0,n.jsx)("div",{className:"space-y-3 text-left",children:H.map(function(e,t){var i=ee===t;return(0,n.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl overflow-hidden",children:[(0,n.jsxs)("button",{type:"button",onClick:function(){return et(i?null:t)},className:"w-full flex items-center justify-between px-5 py-4 text-left hover:bg-gray-50",style:{minHeight:"44px"},"aria-expanded":i,children:[(0,n.jsx)("span",{className:"font-semibold text-gray-900 pr-4",children:e.question}),(0,n.jsx)(J.Z,{size:18,className:"text-[#623ce7] flex-shrink-0 transition-transform ".concat(i?"rotate-180":"")})]}),(0,n.jsx)("div",{style:{display:i?void 0:"none"},className:"px-5 pb-4 text-sm text-gray-700",children:e.answer})]},t)})})]}),(0,n.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Related free tools"}),(0,n.jsx)("p",{className:"text-gray-600 mb-8",children:"Other utilities that pair with the JS Minifier."}),(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:W.map(function(e,t){return(0,n.jsxs)(d(),{href:"/tools/".concat(e.slug,"/"),className:"block bg-white border border-gray-100 rounded-xl p-5 hover:border-[#623ce7] transition-colors group",children:[(0,n.jsx)("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-[#623ce7]",children:e.name}),(0,n.jsx)("p",{className:"text-sm text-gray-600",children:e.description}),(0,n.jsxs)("span",{className:"inline-flex items-center text-sm text-[#623ce7] font-semibold mt-3",children:["Try it ",(0,n.jsx)(z.Z,{size:14,className:"ml-1"})]})]},t)})})]}),(0,n.jsx)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:(0,n.jsxs)("div",{className:"bg-gradient-to-br from-[#623ce7] to-[#3d1d9e] rounded-2xl p-10 md:p-14 text-white",children:[(0,n.jsx)("h2",{className:"text-3xl md:text-4xl font-extrabold mb-4",children:"Minify some JS right now"}),(0,n.jsx)("p",{className:"text-lg mb-8 text-white/90 max-w-2xl mx-auto",children:"Paste, minify, copy. Free, unlimited, no retention."}),(0,n.jsxs)("a",{href:"#tool-interface",className:"inline-flex items-center px-8 py-3 rounded-lg bg-white text-[#623ce7] font-semibold hover:bg-gray-100 transition-colors",style:{minHeight:"44px"},children:["Try the JS Minifier ",(0,n.jsx)(z.Z,{size:18,className:"ml-2"})]})]})})]})]})}}},function(e){e.O(0,[5675,8501,9774,2888,179],function(){return e(e.s=41793)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.