Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any pros to replace Webpack with Parcel when using Angular 4+ version?

I'm wondering is there any solid reason I should replace Webpack with Parcel in Angular 4+ versions? I mean there are a lot of configuration from the Angular team which are specific for Webpack and I'm wondering is it worth it? Will there be any functionality that cannot be replaced? Why should I or shouldn't do it?

like image 834
Marin Takanov Avatar asked Jul 16 '18 07:07

Marin Takanov


2 Answers

Parcel is just easier to setup by yourself (it has 0 config, like, legit) and you don't have to worry about it.

In case of angular, if you are using angular CLI, this has a bunch of configs out of the box that are going to be updated when its necessary so you don't have to worry about it.

If i'm starting a new project (without any cli of similar things) i would stick with parcel, otherwise go with the default one.

like image 65
PlayMa256 Avatar answered Nov 20 '22 20:11

PlayMa256


Parcel and webpack differ in how complicated applications you can build without needing a config file

Parcel

Parcel Does not require Configuration

  1. Parcel creates separate files for CSS, JavaScript bundle, images, etc.
  2. Parcel supports the following transforms without needing a Parcel config-file:
    • CSS
    • SCSS
    • Images
    • Babel
    • PostCSS
    • PostHTML
    • TypeScript
    • ReasonML/BuckleScript ReasonReact
  3. Parcel autodetects what transforms are needed by checking what dependencies are installed and what config files exist.

Webpack

  1. webpack inlines everything in the JavaScript bundle

With webpack, the only features you get without a config file is default input and output files. If you need anything else, such as babel, SCSS, etc, you need the webpack.config.js-file

For most real projects you will still need a config file when you are using webpack 4

For MoreInfo: http://blog.jakoblind.no/parcel-webpack/

like image 44
Chellappan வ Avatar answered Nov 20 '22 21:11

Chellappan வ