🪴 yshalsager's Digital Garden

Search

Search IconIcon to open search

JavaScript Bundling With Parcel

Last updated Aug 16, 2022

المعرفة:: JavaScript
الحالة:: #ملاحظة_مؤرشفة
المراجع:: The Complete JavaScript Course 2022 From Zero to Expert


# How to Use Parcel?

1
2
3
4
  "scripts": {  
    "start": "parcel index.html",  
    "build": "parcel build index.html"  
  },  

# Hot Module Replacement

Whenever a module is changed, Parcel will trigger a rebuild, and that new modified bundle will automatically get injected into the browser without triggering a whole page reload.

1
2
3
if (module.hot) {  
  module.hot.accept();  
}