Leaflet / Leaflet

🍃 JavaScript library for mobile-friendly interactive maps 🇺🇦
https://leafletjs.com
BSD 2-Clause "Simplified" License
40.28k stars 5.76k forks source link

CSS not minified on CDNs #4737

Open r0b- opened 7 years ago

r0b- commented 7 years ago

Hi,

is it possible to minimize the CSS before it's pushed to the CDNs?

Thanks Rob

IvanSanchez commented 7 years ago

@r0b- Yes, it is possible.

But, next time you open an issue, please don't make a question, just state the desired funcionality.


The idea would be to use cssnano (npm install cssnano??), and call it somewhere in build/build.js so that the CSS is minified when making a build.

Alternatively, #4586 would cover this too (even though @mourner opposes splitting the CSS)

FadilEldin commented 3 years ago

Recommend to close

Malvoz commented 2 years ago

@jonkoops would you like to take a look at this, please?

lonix1 commented 1 month ago

On jsdelivr the file 'dist/leaflet.css' is 558.5KiB :open_mouth:

(It's possible to use jsdelivr's "Auto-optimization" feature, but then one doesn't have SRI.)

mourner commented 1 month ago

@lonix1 come on, that's clearly not the case — even the unminified, uncompressed source code for leaflet.css is just 12.5KB. Gzipped it's around 3kb. A minified version would also be around 3kb.

lonix1 commented 1 month ago

@mourner Yes, you're right. The values here are misleading... that is the download count, not the file size! :laughing: :laughing:

JsDelivr's unminified file is 3,814 and its auto-minified file is 3,081, both brotli.