This is a quick guide to loading static files with Parcel. There are two ways to load data in JavaScript:
- including the data in the JavaScript bundle itself
- fetching the data as an external resource
Including data directly in the JavaScript bundle
This is the preferred way of doing things if your data payload is relatively small (<1 MB) as it will lead to fewer network requests (which often gives better perfromance).