When it comes time to bundle your application for production, you can use Parcel's production mode.
parcel build entry.js
Enabling production mode also sets the
NODE_ENV=production environment variable. Large libraries like React have development only debugging features which are disabled by setting this environment variable, which results in smaller and faster builds for production.
To allow setting very aggresive caching rules to your cdn, for optimal performance and efficiency, Parcel hashes the file names of most bundles (according to whether the bundle should have a readable/rememberable name or not, mainly for SEO).
Parcel follows the following table, when it comes to naming bundles. (Entrypoints are never hashed)
|Bundle Type||Type||Content hashed|
|Raw (Images, text files, ...)||Import/Require/...||✅|
The file hash follows the following naming pattern:
In an effort to optimize production build performance, Parcel will try to determine the number of CPUs available at the machine running the build command so it can distribute the work accordingly. To do so, Parcel relies on the physical-cpu-count library.
Be aware that this module assumes you have the
lscpu program available in your system.
If you want to integrate Parcel in your Continuous Integration system (e.g. Travis or Circle CI), you might need to install Parcel as a local dependency.
The instructions can be found here.