DEV Community

Discussion on: Do we really need to minify everything?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I definitely mean Python dev handwrite JavaScript in <script> tags or *.js. I used to do that in the past, with jQuery as well. (And actually, there is one more concern -- Is it safe to use let or const in a <script> tag without a bundler?)

I also used to handwrite *.css without minification as well.

If you use Blade / Twig / Jinja / GoHtml, HTML-minification is the default. But if you use *.html? extension, how do you minify it without Node.js?

Is Node.js essential? No.

What do you usually use, if you don't have Webpack / Parcel / Gulp / Grunt, etc.? Also, CSS, or do you use preprocessors?

Collapse
 
deciduously profile image
Ben Lovy

You can use a locally installed CLI tool to run the minification, and add it to your build pipeline (or Makefile or shell script or whatever ya got).

That said, it's convenient to be able to use npm to hook everything up, and obviously node has html-minifier readily available. I've used it in projects with virtually no JavaScript just for the build tooling, it disappears in the deployed bundle.