question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve minification

See original GitHub issue

The minification of template strings with terser currently is suboptimal, the problem being strings with repeated spaces and line breaks ending up in the minified code (excerpt):

`\n<style>\n*,\n::before,\n::after {\n  box-sizing: border-box;\n}\n\n:host {\n  […]`

This is most probably me holding terser wrong. Essentially I’m looking for something like babel-plugin-minify-template-strings, but for terser. Help wanted.

CC: @RReverser @mathiasbynens

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
tomayaccommented, Oct 4, 2019

You don’t just want minify-template-strings (i.e. just removing whitespace), you want minify-css-in-template-strings. I don’t know of an existing tool that does this.

Eagerly awaiting CSS modules that will make this so much better.

1reaction
tomayaccommented, Oct 4, 2019

Is [:host([hidden]) {…}] necessary?

Yes, it’s a best practice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Improve Performance by Minify & Compress Files
In simple words, minification is the method of removing all the unnecessary things including whitespaces and comments from HTML, CSS, and ...
Read more >
How to Minify CSS and Speed Up Your Website - HubSpot Blog
By stripping unnecessary data from the CSS code, minification helps the browser download and process these files faster, increasing page ...
Read more >
Does minification improve performance? - Stack Overflow
Minification can improve performance, depending on your JavaScript engine. For example, Chrome's V8 optimizing compiler automatically ...
Read more >
How to Minify CSS and JavaScript in WordPress - WP Rocket
CSS and JS minification improve your WordPress site's performance on four different levels: Improve Loading Time. JS and CSS minification increase page ...
Read more >
How to Minify JavaScript — Recommended Tools and Methods
To regain space and improve your page load speed, you must minify the JavaScript code. The minified version of JavaScript code can reduce...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found