Web Resource Minifier
Apply lightweight, dependency-free text transformations to JavaScript, CSS, or HTML in the browser. Minify removes selected comments and whitespace; Beautify adds indentation based on braces or tags. Character, line, and reduction statistics help compare output, but this is not a parser-based optimizer.
How to Use the Web Resource Minifier
Shrink or re-indent a web resource draft locally, then lint and test through your normal toolchain before deployment.
- Choose JavaScript, CSS, or HTML (switching language loads a sample and clears prior output).
- Paste source or select a matching .js, .css, or .html file.
- Select Minify to strip supported comments/whitespace, or Beautify to add simple indentation.
- Compare input vs output and review character count, line count, and reduction percentage.
- Copy or download the result, then run language-aware checks and functional tests before replacing the web resource.
Transformation details
JavaScript scanning tries to protect quoted strings while removing line/block comments and trimming line whitespace. CSS applies pattern-based comment and punctuation spacing changes. HTML tokenization handles tags, comments, and inter-tag whitespace for minify/beautify.
Example
A small function with comments and indentation may minify to fewer lines with comments removed, while Beautify reintroduces brace-based indentation for review. Treat both outputs as drafts until tested in the form or HTML web resource host page.
When to choose another tool
- Need identifier mangling, dead-code elimination, or bundling—use a proper build pipeline.
- Need TypeScript or JSX compile—transpile first, then optionally pass plain JS here.
- Need guaranteed HTML whitespace preservation for preformatted content—review carefully or skip minify.
Mistakes and limitations
- Keep an original source-controlled file; do not make the download your only copy.
- Do not assume Dynamics will accept broken JS just because minification succeeded.
- Regex and template edge cases are classic breakage points for lightweight scanners.
Privacy note
Code stays in the browser for transform and download creation. Client scripts often contain endpoints or internal names—avoid embedding secrets and protect shared copies.
FAQ
How aggressive is minification?
It is a lightweight text transformer, not a parser-based optimizer like terser or cssnano. JavaScript comments and line whitespace, CSS comments and spacing, and HTML comments plus inter-tag whitespace are reduced. Identifiers and expressions are not renamed or fold-optimized.
Can Minify or Beautify change runtime behavior?
Yes, on complex or unusual syntax. Regex literals, template literals, embedded scripts/styles, significant HTML whitespace, malformed markup, and advanced language constructs may be mishandled. Always test before replacing a Dynamics web resource.
What do the size statistics measure?
Character count and line count of the JavaScript strings in memory, plus a reduction percentage versus the input. This is not encoded transfer size, gzip size, or CDN byte count. Beautify can show a negative reduction.
Does switching language keep my previous code?
No. Changing JavaScript / CSS / HTML loads that language's sample and clears prior output. Copy first if you still need the previous buffer.
Does this upload or publish web resources to Dynamics?
No. Transformations and downloads happen in the browser. You must upload the resulting file through your normal solution or web-resource deployment process.
Is source maps or bundling supported?
No. There is no module bundler, tree shaking, TypeScript transpile, Babel pass, or source-map generation—only comment/whitespace oriented transforms.
Does my source code leave the browser?
No ToolsLibrary upload occurs. Pasted or selected .js/.css/.html stay local. Still remove embedded secrets from client-side web resources before sharing downloads.