Day094 — Parcel
I tried parcel for the first time and it is super easy to pick up. Originally, I was hoping to use Gulp or html-minifier to uglify and minify my project. Parcel is too much configuration to be done. It just works out of the box. For my small website, I only need two scripts, start
and build
. You just need to point parcel to the entry file of your website. For my case, it would be index.html
. No need to specify where are your assets (e.g. img, js, file, etc.). They are automatically imported. MAGIC!!!!! No configuration file is needed. It is perfect for a lazy guy like me.
It is easy to use plugin too. Just install it as devDependencies
. DONE.
To optimize images:
To remove output directory before each build(it does not by default):
Should use --public-url ./
:
Tutorial:
js file is generated for each image:
Currently, it still happens. It will be fixed in parcel v2.