Parceljs in Production! (almost)

See this Parcel slogan:

Blazing fast, zero configuration web application bundler

Prior to using it, I saw a number of articles about it and I was like “nice!, finally a tool that allows me to focus on building stuff instead of fine tunning the build infrastructure”

Few months after I got the task to do an integration work. This involves building a custom plugin from a 3rd party system. We get a mixed of raw .js and a transpiled .js

|_ dist/
|_ public/
  |_ index.html
|_ vendor/
  |_ vendor.min.js
|_ src/
  |_ custom.js
  |_ custom.sass
  |_ some.css

The First 30mins

Our project was initially built on top of Babel however we needed to do more than Babel does eg. SASS, CSS, auto-reload. I decided to give a go with Parcel, hooking it up was less of a work - Zero Configuration, fast build time, auto-reload.

The Problem

Everything works! the fact that I could skip out Webpack completely was a huge win. However I noticed my vendor.min.js gets double-transpiled and this has caused my whole dev day finding a better solution or a temporary work-around. There were suggestions and recommendations but I was not totally convinced.

There’s no (better) way for me to mark or skip vendor.min.js from Parcel’s build workflow.

Production (almost)

I pushed back and decided to go with the simplified version:

Optional Configuration

Zero Configuration is an ambitious attempt, definitely I was 95-98% complete - so they’re getting there, it will work with other scenario. An optional configuration might work in this case.

Turns out quite a few people are having this issue. There’s an on-going ticket about this:

How do i mark some modules to external? https://github.com/parcel-bundler/parcel/issues/144

Please support Parcel project. It’s an awesome tool and I’m looking forward to using it in some other project.

Further reading


writings · projects · about · home