Parcel bundler: Testing Parcel’s asset support

Posted on 07-02-2019 , by: admin , in , 0 Comments

Last week I recorded my first impressions with Parcel, the zero-configuration web application bundler. The initial experience was great, and evocative of time travel. Parcel transported me back to my first days with JavaScript, when all you needed was an editor and a browser and you were good to go.

However, I admittedly did not push Parcel very hard or test out many of the cool features available. This week we’ll start to explore some of Parcel’s additional capabilities. I made a grotesque “kitchen sink” of an application in order to see if I could load a bunch of different asset types as expected. 

Starting off the same way as last time, I created an empty directory with a simple index.html with a script tag pointed to an empty index.js file. Then I ran parcel index.html and attempted to write code and let Parcel do all the work.

Parcel claims to support zero-configuration usage for a long list of asset types, which are just file types that may require some special handling. Last week, we only used ES6 flavors of JavaScript, which typically require a Webpack and Babel configuration. This week we’ll test assets that are just data formats (JSON and YAML), assets for styling (CSS and LESS), and application libraries that use different syntax and languages (React and Elm).

Parcel transforms JSON and YAML