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.

Built-in assets compression

See original GitHub issue

It would be great if Lume supports this “natively”. I’ve read that we should be able to accomplish something similar by using processors, but I think HTML and CSS compression/minification could be offered out-of-the box, since it’s far too common, and (I would assume) a high percentage of developers would take advantage of this pretty much by default.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
oscaroterocommented, Oct 25, 2021

Coincidentally I was working on a experimental plugin using that library. You can see it here: https://github.com/lumeland/experimental-plugins

The usage is very simple, there’s a demo here: https://github.com/lumeland/experimental-plugins/blob/main/minify/demo/_config.ts#L8

About cssnano, it’s a good choice, but I need to investigate it better, because it’s not really a library, but a collection of other preconfigured packages (as you can see here: https://github.com/cssnano/cssnano/blob/master/packages/cssnano-preset-default/src/index.js) and it’s not ported to Deno, I think the sno2/minifier library is enough for now.

For now, I won’t include this plugin in the Lume repository because, as you said, the library looks abandoned although it works fine. To use it, just import it directly from github:

import minify from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/minify/minify.ts";

const site = lume();

site
  // You need to load css files if you want to process them
  .loadAssets([".css"])
  .use(minify({
    extensions: [".css", ".html"],
  }));

export default site;

It has some problems with javascript files, but you can use the Terser plugin that is provided by Lume.

0reactions
oscaroterocommented, Jan 29, 2022

The new incoming Lume version (1.5.0) will include the parcel_css plugin, to use Parcel CSS minifier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asset Bundle Compression - Unity - Manual
Unity supports three compression options for Asset Bundles: LZMA, LZ4, and Uncompressed. LZMA Format. By default, when Asset Bundles are built, ...
Read more >
Addressables FAQ | Addressables | 1.16.19
Addressables provides three different options for bundle compression: Uncompressed, LZ4, and LZMA. Generally speaking, LZ4 should be used for ...
Read more >
Front-End Performance 2021: Assets Optimizations
Brotli compression is getting better, so if you can bypass the cost of dynamically compressing static assets, it's definitely worth the effort.
Read more >
Asset Pipeline - Ruby on Rails Guides
The second feature is to minify or compress assets. ... Rails' old strategy was to append a query string to every asset linked...
Read more >
Compression - Docs - Snap Inc.
... content into your Lens, Lens Studio comes with a built-in compression system. ... When importing your assets into Lens Studio, Lens Studio...
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