DEV Community

Hilton Meyer
Hilton Meyer

Posted on • Originally published at hiltonmeyer.com on

 

Parcel Setup

I'm doing the 100 days of Code Challenge with a bit of a twist by trying to create 100 small projects everyday and not just coding. This had me thinking that if I wanted to create a medium sized application I'll need to start looking at bundling. I don't want to get into webpack but then heard about ParcelJS and ease of setup so.

Setup

One of the reasons I wanted to use Parcel was because it had an easy setup. Having no background with any sort of bundlers and having heard of the nightmares of trying to setup Webpack I was really hoping this would be the case that Parcel setup would not be an issue. I'm glad to report that it was as simple as 11ty in getting up and running.

Install Parcel

npm install parcel-bundler --save-dev

In package.json I setup the dev and build commands to develop with:

"scripts": {
    "dev": "parcel src/*.html",
    "build": "parcel build src/*.html"
}

That was it. I ran npm run dev and was off to the races. I now would like to implement some sort of minimization on the javascript being produced and then also see how I can have 11ty working together with Parcel.

Top comments (0)

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!