(The meaning of
~ in this section is described in Module Resolution.)
When Parcel runs, it can build your files in multiple different ways simultaneously. These are called targets.
For example, you could have a "modern" target that targets newer browsers and a "legacy" target for older browsers.
Every entrypoint will be processed (and output) once per target.
¶ Specifying Entrypoints
These are the files that contain the source code to your app before being compiled by Parcel and are picked up by:
$ parcel <entries>
$ parcel <folder(s)>uses
From there, everything those assets depend on will be considered a "source" in Parcel.
¶ Setting the output path
The path where the output bundles should be placed can be specified (in that order) using a top-level field in
package.json (see common targets and custom targets), using
targets.*.distDir or the
--dist-dir CLI parameter.
Default values for the output folder
- for the common targets is
- for custom targets is
The implicit default target has the output folder
With multiple entrypoints, you should use an explicit
distDir as opposed to the top-level target fields because Parcel wouldn't know which bundle should have the specified name:
Environments tell Parcel how to transform and bundle each asset. They tell Parcel if an asset is going to be run in a browser or in Node/Electron.
¶ Configuring Parcel
When you do need to configure Parcel, it will be in one of 3 places.