Parcel Bundler Setup for Web Project

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Parcel Bundler Configuration for Web Project

Parcel is a bundler with zero configuration. You point to entry file, rest it determines itself: finds dependencies, selects transformers, sets up tree-shaking. This makes it excellent choice for quick start of project or prototype where you don't want to spend day on Webpack config.

Installation and run

npm install --save-dev parcel

# Run dev server — just specify HTML
npx parcel index.html

# Production build
npx parcel build index.html

Parcel reads index.html, finds all <script>, <link>, images, processes them automatically. TypeScript, JSX, CSS Modules, PostCSS — everything is picked up without explicit setup, if needed package is installed.

package.json configuration

{
  "scripts": {
    "dev": "parcel src/index.html --port 3000",
    "build": "parcel build src/index.html --no-source-maps",
    "clean": "rm -rf dist .parcel-cache"
  },
  "targets": {
    "default": {
      "browsers": "> 0.5%, last 2 versions, not dead",
      "outputFormat": "esmodule",
      "isLibrary": false
    }
  }
}

TypeScript and React

Install dependencies — Parcel picks them up automatically:

npm install react react-dom
npm install --save-dev typescript @types/react @types/react-dom

Minimal tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "strict": true,
    "skipLibCheck": true
  }
}

After that parcel src/index.html — and TypeScript works without additional configuration.

CSS Modules

/* Button.module.css */
.root {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 4px;
}
import styles from './Button.module.css';

export const Button = ({ children }: { children: React.ReactNode }) => (
  <button className={styles.root}>{children}</button>
);

Parcel automatically handles .module.css as CSS Modules — hashes class names, types them.

SCSS and PostCSS

npm install --save-dev sass

Enough to rename .css to .scss. For PostCSS:

npm install --save-dev postcss autoprefixer

.postcssrc:

{
  "plugins": {
    "autoprefixer": {}
  }
}

Building library

Parcel can build npm packages, reading main, module, types from package.json:

{
  "source": "src/index.ts",
  "main": "dist/index.cjs",
  "module": "dist/index.esm.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "build": "parcel build"
  }
}

Path aliases

{
  "alias": {
    "@components": "./src/components",
    "@utils": "./src/utils"
  }
}

alias section in package.json — and imports like import { Button } from '@components/Button' work.

When Parcel doesn't fit

  • Need detailed control over chunk-splitting and filenames
  • Complex custom build logic (Parcel doesn't assume extensive config)
  • Team already knows Webpack/Vite well and migration creates more questions than solves

Timeline

Setting up Parcel for new React/TypeScript project from scratch: 30–60 minutes. Migrating existing project from Webpack to Parcel: 2–8 hours depending on amount of Webpack custom settings.